incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1373632 [2/5] - in /incubator/isis/trunk/framework: core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ core/metamodel/src/main/java/org/apache/i...
Date Wed, 15 Aug 2012 21:15:42 GMT
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinter.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_polyinter.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinter.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinter.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_polyinter.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_polyinter.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinter.java Wed Aug 15 21:15:39 2012
@@ -1,98 +1,98 @@
-/*
- *  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.jdo.datanucleus.refs;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.refs.PolyClassChildEntity;
-import org.apache.isis.tck.dom.refs.PolyClassParentEntity;
-import org.apache.isis.tck.dom.refs.PolyClassParentEntityRepository;
-import org.apache.isis.tck.dom.refs.PolyInterface;
-import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntity;
-import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntityRepository;
-
-public class Persistence_persist_polyinter {
-
-    private PolyInterfaceParentEntityRepository repo = new PolyInterfaceParentEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACEPARENTENTITY_CHILDREN"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACESUBTYPE1ENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACESUBTYPE2ENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACESUBTYPE3ENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACEPARENTENTITY"))
-        .withServices(repo)
-        .build();
-
-    @Test
-    public void persistTwoParents() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<PolyInterfaceParentEntity> list = repo.list();
-        assertThat(list.size(), is(2));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persistSixDifferentChildrenOfParent() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        PolyInterfaceParentEntity retrievedEntity = repo.list().get(0);
-        retrievedEntity.newSubtype1("Child 1 of Parent 1", 123);
-        retrievedEntity.newSubtype1("Child 2 of Parent 1", 456);
-        retrievedEntity.newSubtype2("Child 3 of Parent 1", "abc");
-        retrievedEntity.newSubtype2("Child 4 of Parent 1", "def");
-        retrievedEntity.newSubtype3("Child 5 of Parent 1", BigDecimal.ONE);
-        retrievedEntity.newSubtype3("Child 6 of Parent 1", BigDecimal.TEN);
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        retrievedEntity = repo.list().get(0);
-        Set<PolyInterface> children = retrievedEntity.getChildren();
-        assertThat(children.size(), is(6));
-        iswf.commitTran();
-    }
-
-
-}
+/*
+ *  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.jdo.datanucleus.scenarios.refs;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.PolyClassChildEntity;
+import org.apache.isis.tck.dom.refs.PolyClassParentEntity;
+import org.apache.isis.tck.dom.refs.PolyClassParentEntityRepository;
+import org.apache.isis.tck.dom.refs.PolyInterface;
+import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntity;
+import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntityRepository;
+
+public class Persistence_persist_polyinter {
+
+    private PolyInterfaceParentEntityRepository repo = new PolyInterfaceParentEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACEPARENTENTITY_CHILDREN"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACESUBTYPE1ENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACESUBTYPE2ENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACESUBTYPE3ENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACEPARENTENTITY"))
+        .withServices(repo)
+        .build();
+
+    @Test
+    public void persistTwoParents() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<PolyInterfaceParentEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persistSixDifferentChildrenOfParent() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        PolyInterfaceParentEntity retrievedEntity = repo.list().get(0);
+        retrievedEntity.newSubtype1("Child 1 of Parent 1", 123);
+        retrievedEntity.newSubtype1("Child 2 of Parent 1", 456);
+        retrievedEntity.newSubtype2("Child 3 of Parent 1", "abc");
+        retrievedEntity.newSubtype2("Child 4 of Parent 1", "def");
+        retrievedEntity.newSubtype3("Child 5 of Parent 1", BigDecimal.ONE);
+        retrievedEntity.newSubtype3("Child 6 of Parent 1", BigDecimal.TEN);
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        retrievedEntity = repo.list().get(0);
+        Set<PolyInterface> children = retrievedEntity.getChildren();
+        assertThat(children.size(), is(6));
+        iswf.commitTran();
+    }
+
+
+}

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinterIdentityStrategy.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_polyinterIdentityStrategy.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinterIdentityStrategy.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinterIdentityStrategy.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_polyinterIdentityStrategy.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_polyinterIdentityStrategy.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_polyinterIdentityStrategy.java Wed Aug 15 21:15:39 2012
@@ -1,100 +1,100 @@
-/*
- *  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.jdo.datanucleus.refs;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.refs.PolyClassChildEntity;
-import org.apache.isis.tck.dom.refs.PolyClassParentEntity;
-import org.apache.isis.tck.dom.refs.PolyClassParentEntityRepository;
-import org.apache.isis.tck.dom.refs.PolyInterface;
-import org.apache.isis.tck.dom.refs.PolyInterfaceIdentityStrategy;
-import org.apache.isis.tck.dom.refs.PolyInterfaceIdentityStrategyParentEntity;
-import org.apache.isis.tck.dom.refs.PolyInterfaceIdentityStrategyParentEntityRepository;
-import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntity;
-import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntityRepository;
-
-public class Persistence_persist_polyinterIdentityStrategy {
-
-    private PolyInterfaceIdentityStrategyParentEntityRepository repo = new PolyInterfaceIdentityStrategyParentEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYPARENTENTITY_CHILDREN"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYSUBTYPE1ENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYSUBTYPE2ENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYSUBTYPE3ENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYPARENTENTITY"))
-        .withServices(repo)
-        .build();
-
-    @Test
-    public void persistTwoParents() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<PolyInterfaceIdentityStrategyParentEntity> list = repo.list();
-        assertThat(list.size(), is(2));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persistSixDifferentChildrenOfParent() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        PolyInterfaceIdentityStrategyParentEntity retrievedEntity = repo.list().get(0);
-        retrievedEntity.newSubtype1("Child 1 of Parent 1", 123);
-        retrievedEntity.newSubtype1("Child 2 of Parent 1", 456);
-        retrievedEntity.newSubtype2("Child 3 of Parent 1", "abc");
-        retrievedEntity.newSubtype2("Child 4 of Parent 1", "def");
-        retrievedEntity.newSubtype3("Child 5 of Parent 1", BigDecimal.ONE);
-        retrievedEntity.newSubtype3("Child 6 of Parent 1", BigDecimal.TEN);
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        retrievedEntity = repo.list().get(0);
-        Set<PolyInterfaceIdentityStrategy> children = retrievedEntity.getChildren();
-        assertThat(children.size(), is(6));
-        iswf.commitTran();
-    }
-
-}
+/*
+ *  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.jdo.datanucleus.scenarios.refs;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.PolyClassChildEntity;
+import org.apache.isis.tck.dom.refs.PolyClassParentEntity;
+import org.apache.isis.tck.dom.refs.PolyClassParentEntityRepository;
+import org.apache.isis.tck.dom.refs.PolyInterface;
+import org.apache.isis.tck.dom.refs.PolyInterfaceIdentityStrategy;
+import org.apache.isis.tck.dom.refs.PolyInterfaceIdentityStrategyParentEntity;
+import org.apache.isis.tck.dom.refs.PolyInterfaceIdentityStrategyParentEntityRepository;
+import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntity;
+import org.apache.isis.tck.dom.refs.PolyInterfaceParentEntityRepository;
+
+public class Persistence_persist_polyinterIdentityStrategy {
+
+    private PolyInterfaceIdentityStrategyParentEntityRepository repo = new PolyInterfaceIdentityStrategyParentEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYPARENTENTITY_CHILDREN"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYSUBTYPE1ENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYSUBTYPE2ENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYSUBTYPE3ENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYINTERFACEIDENTITYSTRATEGYPARENTENTITY"))
+        .withServices(repo)
+        .build();
+
+    @Test
+    public void persistTwoParents() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<PolyInterfaceIdentityStrategyParentEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persistSixDifferentChildrenOfParent() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        PolyInterfaceIdentityStrategyParentEntity retrievedEntity = repo.list().get(0);
+        retrievedEntity.newSubtype1("Child 1 of Parent 1", 123);
+        retrievedEntity.newSubtype1("Child 2 of Parent 1", 456);
+        retrievedEntity.newSubtype2("Child 3 of Parent 1", "abc");
+        retrievedEntity.newSubtype2("Child 4 of Parent 1", "def");
+        retrievedEntity.newSubtype3("Child 5 of Parent 1", BigDecimal.ONE);
+        retrievedEntity.newSubtype3("Child 6 of Parent 1", BigDecimal.TEN);
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        retrievedEntity = repo.list().get(0);
+        Set<PolyInterfaceIdentityStrategy> children = retrievedEntity.getChildren();
+        assertThat(children.size(), is(6));
+        iswf.commitTran();
+    }
+
+}

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_referencing.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persistAndUpdate_referencing.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_referencing.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_referencing.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persistAndUpdate_referencing.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persistAndUpdate_referencing.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_referencing.java Wed Aug 15 21:15:39 2012
@@ -1,225 +1,136 @@
-/*
- *  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.jdo.datanucleus.refs;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.ResolveState;
-import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.refs.UnidirReferencedEntity;
-import org.apache.isis.tck.dom.refs.UnidirReferencedEntityRepository;
-import org.apache.isis.tck.dom.refs.UnidirReferencingEntity;
-import org.apache.isis.tck.dom.refs.UnidirReferencingEntityRepository;
-
-public class Persistence_persistAndUpdate_referencing {
-
-    private UnidirReferencingEntityRepository referencingRepo = new UnidirReferencingEntityRepository();
-    private UnidirReferencedEntityRepository referencedRepo = new UnidirReferencedEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCINGENTITY"))
-        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCEDENTITY"))
-        .withServices(referencingRepo, referencedRepo)
-        .build();
-
-    @Test
-    public void persist() throws Exception {
-        
-        iswf.beginTran();
-        referencedRepo.newEntity().setName("Referenced 1");
-        referencedRepo.newEntity().setName("Referenced 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        UnidirReferencedEntity referencedEntity1 = referencedRepo.list().get(0);
-        UnidirReferencedEntity referencedEntity2 = referencedRepo.list().get(1);
-        
-        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
-        referencingEntity1.setName("Referencing 1");
-        referencingEntity1.setReferenced(referencedEntity1);
-        
-        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
-        referencingEntity2.setName("Referencing 2");
-        referencingEntity2.setReferenced(referencedEntity1);
-
-        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
-        referencingEntity3.setName("Referencing 3");
-        referencingEntity3.setReferenced(referencedEntity2);
-
-        iswf.commitTran();
-        
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<UnidirReferencingEntity> list = referencingRepo.list();
-        referencingEntity1 = list.get(0);
-        referencingEntity2 = list.get(1);
-        referencingEntity3 = list.get(2);
-        
-        assertThat(referencingEntity1.getReferenced(), is(not(nullValue())));
-        assertThat(referencingEntity2.getReferenced(), is(not(nullValue())));
-        assertThat(referencingEntity3.getReferenced(), is(not(nullValue())));
-        
-        assertThat(referencingEntity1.getReferenced(), is(referencingEntity1.getReferenced()));
-        assertThat(referencingEntity1.getReferenced(), is(not(referencingEntity3.getReferenced())));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persistAGraphOfObjects() throws Exception {
-        
-        iswf.beginTran();
-        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
-        referencedEntity1.setName("Referenced 1");
-        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
-        referencedEntity2.setName("Referenced 2");
-
-        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
-        referencingEntity1.setName("Referencing 1");
-        referencingEntity1.setReferenced(referencedEntity1);
-        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
-        referencingEntity2.setName("Referencing 2");
-        referencingEntity2.setReferenced(referencedEntity1);
-        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
-        referencingEntity3.setName("Referencing 3");
-        referencingEntity3.setReferenced(referencedEntity2);
-        iswf.commitTran();
-        
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<UnidirReferencingEntity> list = referencingRepo.list();
-        referencingEntity1 = list.get(0);
-        referencingEntity2 = list.get(1);
-        referencingEntity3 = list.get(2);
-        
-        assertThat(referencingEntity1.getReferenced(), is(not(nullValue())));
-        assertThat(referencingEntity2.getReferenced(), is(not(nullValue())));
-        assertThat(referencingEntity3.getReferenced(), is(not(nullValue())));
-        
-        assertThat(referencingEntity1.getReferenced(), is(referencingEntity1.getReferenced()));
-        assertThat(referencingEntity1.getReferenced(), is(not(referencingEntity3.getReferenced())));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persist_then_update() throws Exception {
-        
-        iswf.beginTran();
-        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
-        referencedEntity1.setName("Referenced 1");
-        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
-        referencedEntity2.setName("Referenced 2");
-
-        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
-        referencingEntity1.setName("Referencing 1");
-        referencingEntity1.setReferenced(referencedEntity1);
-        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
-        referencingEntity2.setName("Referencing 2");
-        referencingEntity2.setReferenced(referencedEntity1);
-        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
-        referencingEntity3.setName("Referencing 3");
-        referencingEntity3.setReferenced(referencedEntity2);
-        iswf.commitTran();
-
-        // when ...
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<UnidirReferencingEntity> referencingList = referencingRepo.list();
-        referencingEntity1 = referencingList.get(0);
-        referencingEntity2 = referencingList.get(1);
-        referencingEntity3 = referencingList.get(2);
-
-        List<UnidirReferencedEntity> referencedList = referencedRepo.list();
-        referencedEntity1 = referencedList.get(0);
-        referencedEntity2 = referencedList.get(1);
-
-        assertThat(referencingEntity2.getReferenced(), is(referencedEntity1));
-
-        // ...switch to refer to other
-        referencingEntity2.setReferenced(referencedEntity2);
-        iswf.commitTran();
-
-        // then...
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        referencingList = referencingRepo.list();
-        referencingEntity1 = referencingList.get(0);
-        referencingEntity2 = referencingList.get(1);
-        referencingEntity3 = referencingList.get(2);
-
-        referencedList = referencedRepo.list();
-        referencedEntity1 = referencedList.get(0);
-        referencedEntity2 = referencedList.get(1);
-
-        // ...is switched
-        assertThat(referencingEntity2.getReferenced(), is(referencedEntity2));
-        iswf.commitTran();
-    }
-
-    
-    @Test
-    public void lazyLoading_and_adapters() throws Exception {
-        iswf.beginTran();
-        referencedRepo.newEntity().setName("Referenced 1");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        UnidirReferencedEntity referencedEntity1 = referencedRepo.list().get(0);
-        
-        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
-        referencingEntity1.setName("Referencing 1");
-        referencingEntity1.setReferenced(referencedEntity1);
-        
-        iswf.commitTran();
-        
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<UnidirReferencingEntity> list = referencingRepo.list();
-        referencingEntity1 = list.get(0);
-        
-        assertThat(referencingEntity1.referenced, is(nullValue())); // lazy loading
-        UnidirReferencedEntity referenced = referencingEntity1.getReferenced();
-        ObjectAdapter referencedAdapter = iswf.adapterFor(referenced);
-        assertThat(referencedAdapter.getResolveState(), is(ResolveState.RESOLVED));
-        assertThat(referenced, is(not(nullValue())));
-        
-        iswf.commitTran();
-    }
-
-}
+/*
+ *  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.jdo.datanucleus.scenarios.refs;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.UnidirReferencedEntity;
+import org.apache.isis.tck.dom.refs.UnidirReferencedEntityRepository;
+import org.apache.isis.tck.dom.refs.UnidirReferencingEntity;
+import org.apache.isis.tck.dom.refs.UnidirReferencingEntityRepository;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Persistence_persist_referencing {
+
+    private UnidirReferencingEntityRepository referencingRepo = new UnidirReferencingEntityRepository();
+    private UnidirReferencedEntityRepository referencedRepo = new UnidirReferencedEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCINGENTITY"))
+        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCEDENTITY"))
+        .withServices(referencingRepo, referencedRepo)
+        .build();
+
+    @Test
+    public void persist() throws Exception {
+        
+        iswf.beginTran();
+        referencedRepo.newEntity().setName("Referenced 1");
+        referencedRepo.newEntity().setName("Referenced 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        UnidirReferencedEntity referencedEntity1 = referencedRepo.list().get(0);
+        UnidirReferencedEntity referencedEntity2 = referencedRepo.list().get(1);
+        
+        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
+        referencingEntity1.setName("Referencing 1");
+        referencingEntity1.setReferenced(referencedEntity1);
+        
+        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
+        referencingEntity2.setName("Referencing 2");
+        referencingEntity2.setReferenced(referencedEntity1);
+
+        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
+        referencingEntity3.setName("Referencing 3");
+        referencingEntity3.setReferenced(referencedEntity2);
+
+        iswf.commitTran();
+        
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<UnidirReferencingEntity> list = referencingRepo.list();
+        referencingEntity1 = list.get(0);
+        referencingEntity2 = list.get(1);
+        referencingEntity3 = list.get(2);
+        
+        assertThat(referencingEntity1.getReferenced(), is(not(nullValue())));
+        assertThat(referencingEntity2.getReferenced(), is(not(nullValue())));
+        assertThat(referencingEntity3.getReferenced(), is(not(nullValue())));
+        
+        assertThat(referencingEntity1.getReferenced(), is(referencingEntity1.getReferenced()));
+        assertThat(referencingEntity1.getReferenced(), is(not(referencingEntity3.getReferenced())));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persistAGraphOfObjects() throws Exception {
+        
+        iswf.beginTran();
+        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
+        referencedEntity1.setName("Referenced 1");
+        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
+        referencedEntity2.setName("Referenced 2");
+
+        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
+        referencingEntity1.setName("Referencing 1");
+        referencingEntity1.setReferenced(referencedEntity1);
+        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
+        referencingEntity2.setName("Referencing 2");
+        referencingEntity2.setReferenced(referencedEntity1);
+        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
+        referencingEntity3.setName("Referencing 3");
+        referencingEntity3.setReferenced(referencedEntity2);
+        iswf.commitTran();
+        
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<UnidirReferencingEntity> list = referencingRepo.list();
+        referencingEntity1 = list.get(0);
+        referencingEntity2 = list.get(1);
+        referencingEntity3 = list.get(2);
+        
+        assertThat(referencingEntity1.getReferenced(), is(not(nullValue())));
+        assertThat(referencingEntity2.getReferenced(), is(not(nullValue())));
+        assertThat(referencingEntity3.getReferenced(), is(not(nullValue())));
+        
+        assertThat(referencingEntity1.getReferenced(), is(referencingEntity1.getReferenced()));
+        assertThat(referencingEntity1.getReferenced(), is(not(referencingEntity3.getReferenced())));
+        iswf.commitTran();
+    }
+
+
+}

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidir.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_unidir.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidir.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidir.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_unidir.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_unidir.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidir.java Wed Aug 15 21:15:39 2012
@@ -1,134 +1,134 @@
-/*
- *  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.jdo.datanucleus.refs;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.refs.BidirWithSetChildEntity;
-import org.apache.isis.tck.dom.refs.BidirWithSetParentEntity;
-import org.apache.isis.tck.dom.refs.BidirWithSetParentEntityRepository;
-import org.apache.isis.tck.dom.refs.ParentEntity;
-import org.apache.isis.tck.dom.refs.ParentEntityRepository;
-import org.apache.isis.tck.dom.refs.UnidirFkChildEntity;
-import org.apache.isis.tck.dom.refs.UnidirFkParentEntity;
-import org.apache.isis.tck.dom.refs.UnidirFkParentEntityRepository;
-
-public class Persistence_persist_unidir {
-
-    private UnidirFkParentEntityRepository repo = new UnidirFkParentEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("UNIDIRFKCHILDENTITY"))
-        .with(Utils.listenerToDeleteFrom("UNIDIRFKPARENTENTITY"))
-        .withServices(repo)
-        .build();
-
-    @Test
-    public void persistTwoParents() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<UnidirFkParentEntity> list = repo.list();
-        assertThat(list.size(), is(2));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persistTwoChildrenOfParent() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        UnidirFkParentEntity retrievedEntity = repo.list().get(0);
-        retrievedEntity.newChild("Child 1 of Parent 1");
-        retrievedEntity.newChild("Child 2 of Parent 1");
-        retrievedEntity.newChild("Child 3 of Parent 1");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        retrievedEntity = repo.list().get(0);
-        Set<UnidirFkChildEntity> children = retrievedEntity.getChildren();
-        assertThat(children.size(), is(3));
-        iswf.commitTran();
-    }
-
-    @Ignore("Not currently working, is an update")
-    @Test
-    public void updateBidirectional() throws Exception {
-        iswf.beginTran();
-        UnidirFkParentEntity parent1 = repo.newEntity();
-        parent1.setName("Parent 1");
-        UnidirFkParentEntity parent2 = repo.newEntity();
-        parent2.setName("Parent 2");
-
-        parent1.newChild("Child 1 of Parent 1");
-        parent1.newChild("Child 2 of Parent 1");
-        parent1.newChild("Child 3 of Parent 1");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        parent1 = repo.list().get(0);
-        parent2 = repo.list().get(0);
-        Set<UnidirFkChildEntity> children = parent1.getChildren();
-        assertThat(children.size(), is(3));
-        UnidirFkChildEntity child1 = parent1.getChildren().iterator().next();
-        parent1.removeChild(child1);
-        parent2.addChild(child1);
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        parent1 = repo.list().get(0);
-        parent2 = repo.list().get(0);
-        children = parent1.getChildren();
-        assertThat(children.size(), is(2));
-        
-        children = parent2.getChildren();
-        assertThat(children.size(), is(1));
-        iswf.commitTran();
-    }
-    
-
-}
+/*
+ *  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.jdo.datanucleus.scenarios.refs;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.BidirWithSetChildEntity;
+import org.apache.isis.tck.dom.refs.BidirWithSetParentEntity;
+import org.apache.isis.tck.dom.refs.BidirWithSetParentEntityRepository;
+import org.apache.isis.tck.dom.refs.ParentEntity;
+import org.apache.isis.tck.dom.refs.ParentEntityRepository;
+import org.apache.isis.tck.dom.refs.UnidirFkChildEntity;
+import org.apache.isis.tck.dom.refs.UnidirFkParentEntity;
+import org.apache.isis.tck.dom.refs.UnidirFkParentEntityRepository;
+
+public class Persistence_persist_unidir {
+
+    private UnidirFkParentEntityRepository repo = new UnidirFkParentEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("UNIDIRFKCHILDENTITY"))
+        .with(Utils.listenerToDeleteFrom("UNIDIRFKPARENTENTITY"))
+        .withServices(repo)
+        .build();
+
+    @Test
+    public void persistTwoParents() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<UnidirFkParentEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persistTwoChildrenOfParent() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        UnidirFkParentEntity retrievedEntity = repo.list().get(0);
+        retrievedEntity.newChild("Child 1 of Parent 1");
+        retrievedEntity.newChild("Child 2 of Parent 1");
+        retrievedEntity.newChild("Child 3 of Parent 1");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        retrievedEntity = repo.list().get(0);
+        Set<UnidirFkChildEntity> children = retrievedEntity.getChildren();
+        assertThat(children.size(), is(3));
+        iswf.commitTran();
+    }
+
+    @Ignore("Not currently working, is an update")
+    @Test
+    public void updateBidirectional() throws Exception {
+        iswf.beginTran();
+        UnidirFkParentEntity parent1 = repo.newEntity();
+        parent1.setName("Parent 1");
+        UnidirFkParentEntity parent2 = repo.newEntity();
+        parent2.setName("Parent 2");
+
+        parent1.newChild("Child 1 of Parent 1");
+        parent1.newChild("Child 2 of Parent 1");
+        parent1.newChild("Child 3 of Parent 1");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        parent1 = repo.list().get(0);
+        parent2 = repo.list().get(0);
+        Set<UnidirFkChildEntity> children = parent1.getChildren();
+        assertThat(children.size(), is(3));
+        UnidirFkChildEntity child1 = parent1.getChildren().iterator().next();
+        parent1.removeChild(child1);
+        parent2.addChild(child1);
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        parent1 = repo.list().get(0);
+        parent2 = repo.list().get(0);
+        children = parent1.getChildren();
+        assertThat(children.size(), is(2));
+        
+        children = parent2.getChildren();
+        assertThat(children.size(), is(1));
+        iswf.commitTran();
+    }
+    
+
+}

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidirJoin.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_unidirJoin.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidirJoin.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidirJoin.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_unidirJoin.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_unidirJoin.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_persist_unidirJoin.java Wed Aug 15 21:15:39 2012
@@ -1,137 +1,137 @@
-/*
- *  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.jdo.datanucleus.refs;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.refs.BidirWithSetChildEntity;
-import org.apache.isis.tck.dom.refs.BidirWithSetParentEntity;
-import org.apache.isis.tck.dom.refs.BidirWithSetParentEntityRepository;
-import org.apache.isis.tck.dom.refs.ParentEntity;
-import org.apache.isis.tck.dom.refs.ParentEntityRepository;
-import org.apache.isis.tck.dom.refs.UnidirFkChildEntity;
-import org.apache.isis.tck.dom.refs.UnidirFkParentEntity;
-import org.apache.isis.tck.dom.refs.UnidirFkParentEntityRepository;
-import org.apache.isis.tck.dom.refs.UnidirJoinChildEntity;
-import org.apache.isis.tck.dom.refs.UnidirJoinParentEntity;
-import org.apache.isis.tck.dom.refs.UnidirJoinParentEntityRepository;
-
-public class Persistence_persist_unidirJoin {
-
-    private UnidirJoinParentEntityRepository repo = new UnidirJoinParentEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("UNIDIRJOINCHILDENTITY"))
-        .with(Utils.listenerToDeleteFrom("UNIDIRJOINPARENTENTITY"))
-        .withServices(repo)
-        .build();
-
-    @Test
-    public void persistTwoParents() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<UnidirJoinParentEntity> list = repo.list();
-        assertThat(list.size(), is(2));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persistTwoChildrenOfParent() throws Exception {
-        iswf.beginTran();
-        repo.newEntity().setName("Parent 1");
-        repo.newEntity().setName("Parent 2");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        UnidirJoinParentEntity retrievedEntity = repo.list().get(0);
-        retrievedEntity.newChild("Child 1 of Parent 1");
-        retrievedEntity.newChild("Child 2 of Parent 1");
-        retrievedEntity.newChild("Child 3 of Parent 1");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        retrievedEntity = repo.list().get(0);
-        Set<UnidirJoinChildEntity> children = retrievedEntity.getChildren();
-        assertThat(children.size(), is(3));
-        iswf.commitTran();
-    }
-
-    @Ignore("Not currently working, is an update")
-    @Test
-    public void updateBidirectional() throws Exception {
-        iswf.beginTran();
-        UnidirJoinParentEntity parent1 = repo.newEntity();
-        parent1.setName("Parent 1");
-        UnidirJoinParentEntity parent2 = repo.newEntity();
-        parent2.setName("Parent 2");
-
-        parent1.newChild("Child 1 of Parent 1");
-        parent1.newChild("Child 2 of Parent 1");
-        parent1.newChild("Child 3 of Parent 1");
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        parent1 = repo.list().get(0);
-        parent2 = repo.list().get(0);
-        Set<UnidirJoinChildEntity> children = parent1.getChildren();
-        assertThat(children.size(), is(3));
-        UnidirJoinChildEntity child1 = parent1.getChildren().iterator().next();
-        parent1.removeChild(child1);
-        parent2.addChild(child1);
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        parent1 = repo.list().get(0);
-        parent2 = repo.list().get(0);
-        children = parent1.getChildren();
-        assertThat(children.size(), is(2));
-        
-        children = parent2.getChildren();
-        assertThat(children.size(), is(1));
-        iswf.commitTran();
-    }
-    
-
-}
+/*
+ *  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.jdo.datanucleus.scenarios.refs;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.BidirWithSetChildEntity;
+import org.apache.isis.tck.dom.refs.BidirWithSetParentEntity;
+import org.apache.isis.tck.dom.refs.BidirWithSetParentEntityRepository;
+import org.apache.isis.tck.dom.refs.ParentEntity;
+import org.apache.isis.tck.dom.refs.ParentEntityRepository;
+import org.apache.isis.tck.dom.refs.UnidirFkChildEntity;
+import org.apache.isis.tck.dom.refs.UnidirFkParentEntity;
+import org.apache.isis.tck.dom.refs.UnidirFkParentEntityRepository;
+import org.apache.isis.tck.dom.refs.UnidirJoinChildEntity;
+import org.apache.isis.tck.dom.refs.UnidirJoinParentEntity;
+import org.apache.isis.tck.dom.refs.UnidirJoinParentEntityRepository;
+
+public class Persistence_persist_unidirJoin {
+
+    private UnidirJoinParentEntityRepository repo = new UnidirJoinParentEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("UNIDIRJOINCHILDENTITY"))
+        .with(Utils.listenerToDeleteFrom("UNIDIRJOINPARENTENTITY"))
+        .withServices(repo)
+        .build();
+
+    @Test
+    public void persistTwoParents() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<UnidirJoinParentEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persistTwoChildrenOfParent() throws Exception {
+        iswf.beginTran();
+        repo.newEntity().setName("Parent 1");
+        repo.newEntity().setName("Parent 2");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        UnidirJoinParentEntity retrievedEntity = repo.list().get(0);
+        retrievedEntity.newChild("Child 1 of Parent 1");
+        retrievedEntity.newChild("Child 2 of Parent 1");
+        retrievedEntity.newChild("Child 3 of Parent 1");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        retrievedEntity = repo.list().get(0);
+        Set<UnidirJoinChildEntity> children = retrievedEntity.getChildren();
+        assertThat(children.size(), is(3));
+        iswf.commitTran();
+    }
+
+    @Ignore("Not currently working, is an update")
+    @Test
+    public void updateBidirectional() throws Exception {
+        iswf.beginTran();
+        UnidirJoinParentEntity parent1 = repo.newEntity();
+        parent1.setName("Parent 1");
+        UnidirJoinParentEntity parent2 = repo.newEntity();
+        parent2.setName("Parent 2");
+
+        parent1.newChild("Child 1 of Parent 1");
+        parent1.newChild("Child 2 of Parent 1");
+        parent1.newChild("Child 3 of Parent 1");
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        parent1 = repo.list().get(0);
+        parent2 = repo.list().get(0);
+        Set<UnidirJoinChildEntity> children = parent1.getChildren();
+        assertThat(children.size(), is(3));
+        UnidirJoinChildEntity child1 = parent1.getChildren().iterator().next();
+        parent1.removeChild(child1);
+        parent2.addChild(child1);
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        parent1 = repo.list().get(0);
+        parent2 = repo.list().get(0);
+        children = parent1.getChildren();
+        assertThat(children.size(), is(2));
+        
+        children = parent2.getChildren();
+        assertThat(children.size(), is(1));
+        iswf.commitTran();
+    }
+    
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_update_using_domMethodCalls.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_update_using_domMethodCalls.java?rev=1373632&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_update_using_domMethodCalls.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/Persistence_update_using_domMethodCalls.java Wed Aug 15 21:15:39 2012
@@ -0,0 +1,113 @@
+/*
+ *  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.jdo.datanucleus.scenarios.refs;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.UnidirReferencedEntity;
+import org.apache.isis.tck.dom.refs.UnidirReferencedEntityRepository;
+import org.apache.isis.tck.dom.refs.UnidirReferencingEntity;
+import org.apache.isis.tck.dom.refs.UnidirReferencingEntityRepository;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Persistence_update_using_domMethodCalls {
+
+    private UnidirReferencingEntityRepository referencingRepo = new UnidirReferencingEntityRepository();
+    private UnidirReferencedEntityRepository referencedRepo = new UnidirReferencedEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCINGENTITY"))
+        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCEDENTITY"))
+        .withServices(referencingRepo, referencedRepo)
+        .build();
+
+
+    @Test
+    public void persist_then_update() throws Exception {
+        
+        iswf.beginTran();
+        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
+        referencedEntity1.setName("Referenced 1");
+        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
+        referencedEntity2.setName("Referenced 2");
+
+        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
+        referencingEntity1.setName("Referencing 1");
+        referencingEntity1.setReferenced(referencedEntity1);
+        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
+        referencingEntity2.setName("Referencing 2");
+        referencingEntity2.setReferenced(referencedEntity1);
+        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
+        referencingEntity3.setName("Referencing 3");
+        referencingEntity3.setReferenced(referencedEntity2);
+        
+        iswf.commitTran();
+        
+        // when ...
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<UnidirReferencingEntity> referencingList = referencingRepo.list();
+        referencingEntity1 = referencingList.get(0);
+        referencingEntity2 = referencingList.get(1);
+        referencingEntity3 = referencingList.get(2);
+
+        List<UnidirReferencedEntity> referencedList = referencedRepo.list();
+        referencedEntity1 = referencedList.get(0);
+        referencedEntity2 = referencedList.get(1);
+
+        assertThat(referencingEntity2.getReferenced(), is(referencedEntity1));
+
+        // ...switch to refer to other
+        referencingEntity2.setReferenced(referencedEntity2);
+        iswf.commitTran();
+
+        // then...
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        referencingList = referencingRepo.list();
+        referencingEntity1 = referencingList.get(0);
+        referencingEntity2 = referencingList.get(1);
+        referencingEntity3 = referencingList.get(2);
+
+        referencedList = referencedRepo.list();
+        referencedEntity1 = referencedList.get(0);
+        referencedEntity2 = referencedList.get(1);
+
+        // ...is switched
+        assertThat(referencingEntity2.getReferenced(), is(referencedEntity2));
+        iswf.commitTran();
+        
+    }
+
+}

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_allInstances.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_allInstances.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_allInstances.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_allInstances.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_allInstances.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_allInstances.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_allInstances.java Wed Aug 15 21:15:39 2012
@@ -1,86 +1,86 @@
-/*
- *  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.jdo.datanucleus.scalar;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
-
-public class Persistence_allInstances {
-
-    private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
-        .withServices(repo)
-        .build();
-
-    @Test
-    public void whenNoInstances() {
-        iswf.beginTran();
-        final List<PrimitiveValuedEntity> list = repo.list();
-        assertThat(list.size(), is(0));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persist_dontBounce_listAll() throws Exception {
-        
-        iswf.beginTran();
-        PrimitiveValuedEntity entity = repo.newEntity();
-        entity.setId(1);
-        entity = repo.newEntity();
-        entity.setId(2);
-        iswf.commitTran();
-
-        // don't bounce
-        iswf.beginTran();
-        List<PrimitiveValuedEntity> list = repo.list();
-        assertThat(list.size(), is(2));
-        iswf.commitTran();
-    }
-
-    @Test
-    public void persist_bounce_listAll() throws Exception {
-        
-        iswf.beginTran();
-        repo.newEntity().setId(1);
-        repo.newEntity().setId(2);
-        iswf.commitTran();
-
-        iswf.bounceSystem();
-        
-        iswf.beginTran();
-        List<PrimitiveValuedEntity> list = repo.list();
-        assertThat(list.size(), is(2));
-        iswf.commitTran();
-    }
-
-
-}
+/*
+ *  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.jdo.datanucleus.scenarios.scalar;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_allInstances {
+
+    private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
+        .withServices(repo)
+        .build();
+
+    @Test
+    public void whenNoInstances() {
+        iswf.beginTran();
+        final List<PrimitiveValuedEntity> list = repo.list();
+        assertThat(list.size(), is(0));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persist_dontBounce_listAll() throws Exception {
+        
+        iswf.beginTran();
+        PrimitiveValuedEntity entity = repo.newEntity();
+        entity.setId(1);
+        entity = repo.newEntity();
+        entity.setId(2);
+        iswf.commitTran();
+
+        // don't bounce
+        iswf.beginTran();
+        List<PrimitiveValuedEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+    @Test
+    public void persist_bounce_listAll() throws Exception {
+        
+        iswf.beginTran();
+        repo.newEntity().setId(1);
+        repo.newEntity().setId(2);
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<PrimitiveValuedEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+
+}

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_bounceSystem.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_bounceSystem.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_bounceSystem.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_bounceSystem.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_bounceSystem.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_bounceSystem.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_bounceSystem.java Wed Aug 15 21:15:39 2012
@@ -1,44 +1,44 @@
-/*
- *  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.jdo.datanucleus.scalar;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
-
-public class Persistence_bounceSystem {
-
-    private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
-        .withServices(repo)
-        .build();
-
-    @Test
-    public void bounceSystem() throws Exception {
-        iswf.bounceSystem();
-        iswf.bounceSystem();
-    }
-
-}
+/*
+ *  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.jdo.datanucleus.scenarios.scalar;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_bounceSystem {
+
+    private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
+        .withServices(repo)
+        .build();
+
+    @Test
+    public void bounceSystem() throws Exception {
+        iswf.bounceSystem();
+        iswf.bounceSystem();
+    }
+
+}

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_findInstance.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_findInstance.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_findInstance.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_findInstance.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_findInstance.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_findInstance.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_findInstance.java Wed Aug 15 21:15:39 2012
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.scalar;
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.scenarios.scalar;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_all.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_namedQuery_all.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_all.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_all.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_namedQuery_all.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_namedQuery_all.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_all.java Wed Aug 15 21:15:39 2012
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.scalar;
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.scenarios.scalar;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_firstOnly.java (from r1372659, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_namedQuery_firstOnly.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_firstOnly.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_firstOnly.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_namedQuery_firstOnly.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_namedQuery_firstOnly.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_namedQuery_firstOnly.java Wed Aug 15 21:15:39 2012
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.scalar;
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.scenarios.scalar;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;



Mime
View raw message