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 [1/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
Author: danhaywood
Date: Wed Aug 15 21:15:39 2012
New Revision: 1373632

URL: http://svn.apache.org/viewvc?rev=1373632&view=rev
Log:
ISIS-14: refactoring runtime, adding tests for JDO objectstore

* removed OidStringifier
* enhanced JdoSerializer (of id strings)
* added update tests
* moved AdapterCreator responsibility into AdapterManager

Added:
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_canRoundtrip.java
      - copied, changed from r1372659, incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidStringifierDirectTest_canRoundtrip.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_lazyLoading.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_loadObject.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_persistentAdapterFor.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/refs/
    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_bidirWithListParent.java
      - copied, changed 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_bidirWithListParent.java
    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_bidirWithSetParent.java
      - copied, changed 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_bidirWithSetParent.java
    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_polyclass.java
      - copied, changed 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_polyclass.java
    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
      - copied, changed 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
    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
      - copied, changed 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
    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
      - copied, changed 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
    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
      - copied, changed 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
    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
      - copied, changed 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
    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
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/
    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
      - copied, changed 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
    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
      - copied, changed 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
    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
      - copied, changed 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
    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
      - copied, changed 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
    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
      - copied, changed 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
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_applibValuedEntity.java
      - copied, changed 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_persistAndUpdate_applibValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_jdkValuedEntity.java
      - copied, changed 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_persistAndUpdate_jdkValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_objectAdapters.java
      - copied, changed 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_persistAndUpdate_objectAdapters.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_primitiveValuedEntity.java
      - copied, changed 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_persistAndUpdate_primitiveValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_wrapperValuedEntity.java
      - copied, changed 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_persistAndUpdate_wrapperValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persist_dataStoreAssignedPrimaryKey.java
      - copied, changed 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_persist_dataStoreAssignedPrimaryKey.java
Removed:
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidStringifier.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/GivenOidStringifierDirectWhenInstantiateTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidConformant.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidStringifierDirectTest_canRoundtrip.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidWithNonPublicDestringMethod.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidWithNonStaticDestringMethod.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/RootOidAbstractForTesting.java
    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
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_bidirWithListParent.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_bidirWithSetParent.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/refs/Persistence_persist_polyclass.java
    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
    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
    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
    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
    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
    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
    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
    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
    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
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_persistAndUpdate_applibValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_persistAndUpdate_jdkValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_persistAndUpdate_objectAdapters.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_persistAndUpdate_primitiveValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_persistAndUpdate_wrapperValuedEntity.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scalar/Persistence_persist_dataStoreAssignedPrimaryKey.java
Modified:
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterRecreator.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializer.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializerTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReader.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/ObjectReaderMongoIntegrationTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMappingAbstract.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AbstractAutoMapper.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureFilePersistor.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Data.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/services/SimpleRepository.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/AdapterLifecycleTransitioner.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/OidGenerator.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/Persistor.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixtures.java
    incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/WrapperValuedEntity.java
    incubator/isis/trunk/framework/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/SetUpObjectsPeer.java
    incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/content/AbstractObjectContent.java
    incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/context/PersistentRootAdapterMapping.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/ResourceContext.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/representations/ReprRendererAbstract.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/resources/ResourceAbstract.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/resources/domainobjects/DomainObjectLinkTo.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/resources/domainobjects/DomainObjectReprRenderer.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/resources/domainobjects/DomainObjectResourceServerside.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/resources/domaintypes/DomainTypeResourceServerside.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/util/OidUtils.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/test/java/org/apache/isis/viewer/restfulobjects/viewer/ResourceContextTest_ensureCompatibleAcceptHeader.java
    incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/test/java/org/apache/isis/viewer/restfulobjects/viewer/ResourceContextTest_getArg.java
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/DefaultOidObjectMapping.java
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/Mapping.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/appactions/cssmenu/AppActionsCssMenuFactory.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/appactions/cssmenu/AppActionsCssMenuLinkFactory.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/dropdownchoices/DropDownChoicesForObjectAdapterMementos.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/formcomponent/FormComponentPanelAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/action/ActionPage.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/FormAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/PanelAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/test/java/org/apache/isis/viewer/wicket/ui/fixtures/SystemFixtures.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/integration/wicket/ConverterForObjectAdapter.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/integration/wicket/ConverterForObjectAdapterMemento.java

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java Wed Aug 15 21:15:39 2012
@@ -21,7 +21,10 @@ package org.apache.isis.core.metamodel.a
 
 import org.apache.isis.core.commons.components.Injectable;
 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.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
 
 /**
@@ -65,6 +68,29 @@ public interface AdapterManager extends 
 
     
     /**
+     * Either returns an existing {@link ObjectAdapter adapter} (as per 
+     * {@link #getAdapterFor(Oid)}), otherwise re-creates an adapter with the 
+     * specified (persistent) {@link Oid}.
+     * 
+     * <p>
+     * Typically called when the {@link Oid} is already known, that is, when
+     * resolving an already-persisted object. Is also available for
+     * <tt>Memento</tt> support however, so {@link Oid} could also represent a
+     * {@link Oid#isTransient() transient} object.
+     * 
+     * <p>
+     * The pojo itself is recreated by delegating to a {@link PojoRecreator} implementation.
+     * The default impl just uses the {@link ObjectSpecification#createObject()};
+     * however object stores (eg JDO/DataNucleus) can provide alternative implementations
+     * in order to ensure that the created pojo is attached to a persistence context.
+     * 
+     * <p>
+     * If the {@link ObjectAdapter adapter} is recreated, its
+     * {@link ResolveState} will be set to {@link ResolveState#GHOST}.
+     */
+    ObjectAdapter adapterFor(TypedOid oid);
+
+    /**
      * Looks up or creates a standalone (value) or root adapter.
      */
     ObjectAdapter adapterFor(Object domainObject);

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterRecreator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterRecreator.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterRecreator.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterRecreator.java Wed Aug 15 21:15:39 2012
@@ -16,36 +16,9 @@
  */
 package org.apache.isis.core.metamodel.adapter.mgr;
 
-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.core.metamodel.spec.ObjectSpecification;
 
 public interface AdapterRecreator {
 
-    /**
-     * Either returns an existing {@link ObjectAdapter adapter} (as per 
-     * {@link #getAdapterFor(Oid)}), otherwise re-creates an adapter with the 
-     * specified (persistent) {@link Oid}.
-     * 
-     * <p>
-     * Typically called when the {@link Oid} is already known, that is, when
-     * resolving an already-persisted object. Is also available for
-     * <tt>Memento</tt> support however, so {@link Oid} could also represent a
-     * {@link Oid#isTransient() transient} object.
-     * 
-     * <p>
-     * The pojo itself is recreated by delegating to a {@link PojoRecreator} implementation.
-     * The default impl just uses the {@link ObjectSpecification#createObject()};
-     * however object stores (eg JDO/DataNucleus) can provide alternative implementations
-     * in order to ensure that the created pojo is attached to a persistence context.
-     * 
-     * <p>
-     * If the {@link ObjectAdapter adapter} is recreated, its
-     * {@link ResolveState} will be set to {@link ResolveState#GHOST}.
-     */
-    ObjectAdapter recreatePersistentAdapter(TypedOid oid);
 
     
 

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java Wed Aug 15 21:15:39 2012
@@ -32,6 +32,7 @@ import org.apache.isis.core.commons.enco
 import org.apache.isis.core.commons.encoding.DataOutputExtended;
 import org.apache.isis.core.commons.ensure.Ensure;
 import org.apache.isis.core.commons.matchers.IsisMatchers;
+import org.apache.isis.core.commons.url.UrlEncodingUtils;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 
 public final class RootOidDefault implements Serializable, RootOid {
@@ -97,6 +98,11 @@ public final class RootOidDefault implem
     // deString'able, enString
     // ////////////////////////////////////////////
 
+    public static RootOid deStringEncoded(final String urlEncodedOidStr) {
+        final String oidStr = UrlEncodingUtils.urlDecode(urlEncodedOidStr);
+        return deString(oidStr);
+    }
+
     public static RootOidDefault deString(final String oidStr) {
         return getOidMarshaller().unmarshal(oidStr, RootOidDefault.class);
     }

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java Wed Aug 15 21:15:39 2012
@@ -44,6 +44,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManagerAbstract;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
 import org.apache.isis.core.metamodel.runtimecontext.RuntimeContextAbstract;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.spec.ObjectInstantiationException;
@@ -109,9 +110,15 @@ public class RuntimeContextNoRuntime ext
             }
 
             @Override
+            public ObjectAdapter adapterFor(TypedOid oid) {
+            	throw new UnsupportedOperationException("Not supported by this implementation of RuntimeContext");
+            }
+            
+            @Override
             public ObjectAdapter getAdapterFor(Oid oid) {
                 throw new UnsupportedOperationException("Not supported by this implementation of RuntimeContext");
             }
+
         };
         objectInstantiator = new ObjectInstantiatorAbstract() {
 

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java Wed Aug 15 21:15:39 2012
@@ -254,8 +254,23 @@ public class ObjectReflectorDefault impl
         // prime cache and validate
         primeCache();
         metaModelValidator.validate();
+        
+        cacheBySpecId();
     }
 
+	private void cacheBySpecId() {
+		final Map<ObjectSpecId, ObjectSpecification> specById = Maps.newHashMap();
+        for (final ObjectSpecification objSpec : allSpecifications()) {
+            final ObjectSpecId objectSpecId = objSpec.getSpecId();
+            if (objectSpecId == null) {
+                continue;
+            }
+            specById.put(objectSpecId, objSpec);
+        }
+
+        getCache().setCacheBySpecId(specById);
+	}
+
     /**
      * load the service specifications and then, using the
      * {@link #getSpecificationTraverser() traverser}, keep loading all
@@ -613,10 +628,6 @@ public class ObjectReflectorDefault impl
             }
             throw new MetaModelInvalidException(MessageFormat.format("Cannot have two entities with same object type (@ObjectType facet or equivalent) Value; " + "both {0} and {1} are annotated with value of ''{2}''.", existingSpec.getFullIdentifier(), objSpec.getFullIdentifier(), objectSpecId));
         }
-        
-        getCache().setCacheBySpecId(specById);
     }
 
-
-
 }

Copied: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_canRoundtrip.java (from r1372659, incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidStringifierDirectTest_canRoundtrip.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_canRoundtrip.java?p2=incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_canRoundtrip.java&p1=incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidStringifierDirectTest_canRoundtrip.java&r1=1372659&r2=1373632&rev=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/stringable/OidStringifierDirectTest_canRoundtrip.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_canRoundtrip.java Wed Aug 15 21:15:39 2012
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.core.metamodel.adapter.oid.stringable;
+package org.apache.isis.core.metamodel.adapter.oid;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;
@@ -30,28 +30,27 @@ import org.junit.Test;
 
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 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;
 
-public class OidStringifierDirectTest_canRoundtrip {
+public class RootOidDefaultTest_canRoundtrip {
 
-    private OidStringifier oidStringifier;
     private RootOid directlyStringableOid;
 
     @Before
     public void setUp() {
-        directlyStringableOid = new OidConformant();
-        oidStringifier = new OidStringifier(OidConformant.class);
+        directlyStringableOid = RootOidDefault.create(ObjectSpecId.of("CUS"), "123");
     }
 
     @After
     public void tearDown() {
         directlyStringableOid = null;
-        oidStringifier = null;
     }
 
     @Test
     public void withConformantOidClassThenCorrectlyInitialized() {
-        final String enString = oidStringifier.enString(directlyStringableOid);
-        final Oid deString = oidStringifier.deString(enString);
+        final String enString = directlyStringableOid.enString();
+        final Oid deString = RootOidDefault.deStringEncoded(enString);
         assertThat(deString, is(not(nullValue())));
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusObjectStore.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusObjectStore.java Wed Aug 15 21:15:39 2012
@@ -384,9 +384,8 @@ public class DataNucleusObjectStore impl
     }
     
     public static Object idValueOf(final RootOid oid) {
-        String idStr = oid.getIdentifier();
 
-        Object dnOid = JdoOidSerializer.toOidStr(idStr);
+        Object dnOid = JdoOidSerializer.toOidStr(oid);
 
         return dnOid.toString();
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializer.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializer.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializer.java Wed Aug 15 21:15:39 2012
@@ -2,7 +2,15 @@ package org.apache.isis.runtimes.dflt.ob
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.datanucleus.identity.OID;
 
 public final class JdoOidSerializer {
@@ -20,6 +28,15 @@ public final class JdoOidSerializer {
     }
 
     public static String toString(Object jdoOid) {
+        if(jdoOid instanceof javax.jdo.identity.IntIdentity) {
+            return "i" + SEPARATOR + jdoOid; 
+        }
+        if(jdoOid instanceof javax.jdo.identity.StringIdentity) {
+            return "s" + SEPARATOR + jdoOid; 
+        }
+        if(jdoOid instanceof javax.jdo.identity.LongIdentity) {
+            return "l" + SEPARATOR + jdoOid; 
+        }
         if(jdoOid instanceof OID) {
             OID dnOid = (OID) jdoOid;
             Object keyValue = dnOid.getKeyValue();
@@ -28,10 +45,19 @@ public final class JdoOidSerializer {
             if(keyValue instanceof String) {
                 return "S" + SEPARATOR + keyValue; 
             }
-            
+
+            if(keyValue instanceof Long) {
+                return "L" + SEPARATOR + keyValue; 
+            }
+
+            if(keyValue instanceof BigInteger) {
+                return "B" + SEPARATOR + keyValue; 
+            }
+
             if(keyValue instanceof Integer) {
                 return "I" + SEPARATOR + keyValue; 
             }
+
         }
         
         // the JDO spec (5.4.3) requires that OIDs are serializable toString and 
@@ -39,13 +65,18 @@ public final class JdoOidSerializer {
         return jdoOid.getClass().getName().toString() + SEPARATOR + jdoOid.toString();
     }
 
-    public static String toOidStr(String jdoStr) {
-        final int colonIdx = jdoStr.indexOf(SEPARATOR);
-        final String oidAsString = jdoStr.substring(colonIdx+1);
+    private static List<String> prefixes = Arrays.asList("S", "I", "L", "B", "s", "i", "l");
+    
+    public static String toOidStr(RootOid oid) {
+    	String idStr = oid.getIdentifier();
+        final int colonIdx = idStr.indexOf(SEPARATOR);
+        final String oidAsString = idStr.substring(colonIdx+1);
         
-        final String firstPart = jdoStr.substring(0, colonIdx);
-        if("S".equals(firstPart) || "I".equals(firstPart)) {
-            return oidAsString; 
+        final String firstPart = idStr.substring(0, colonIdx);
+        if(prefixes.contains(firstPart)) {
+            ObjectSpecId objectSpecId = oid.getObjectSpecId();
+            ObjectSpecification spec = getSpecificationLoader().lookupBySpecId(objectSpecId);
+			return oidAsString + "[OID]" + spec.getFullIdentifier(); 
         }
         
         final String clsName = firstPart;
@@ -70,4 +101,8 @@ public final class JdoOidSerializer {
             throw new JdoOidSerializer.Exception(e);
         }
     }
+
+	private static SpecificationLoaderSpi getSpecificationLoader() {
+		return IsisContext.getSpecificationLoader();
+	}
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializerTest.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/persistence/spi/JdoOidSerializerTest.java?rev=1373632&r1=1373631&r2=1373632&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializerTest.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/JdoOidSerializerTest.java Wed Aug 15 21:15:39 2012
@@ -1,46 +1,136 @@
 package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.spi;
 
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 
-import org.datanucleus.identity.OIDImpl;
-import org.junit.Test;
+import java.math.BigInteger;
+import java.util.Date;
 
+import org.apache.isis.applib.annotation.ObjectType;
 import org.apache.isis.core.commons.matchers.IsisMatchers;
+import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.datanucleus.identity.OIDImpl;
+import org.junit.Rule;
+import org.junit.Test;
 
 public class JdoOidSerializerTest {
 
+	@ObjectType("CUS")
+	public static class Customer {}
+	
+	public static class CustomerRepository {
+		public void foo(Customer x) {}
+	}
+	
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder()
+        .withServices(new CustomerRepository())
+        .build();
+    
+    
+    @Test
+    public void whenJavaxJdoIntIdentity() throws Exception {
+        Object jdoOid = new javax.jdo.identity.IntIdentity(Customer.class, 123);
+        String id = JdoOidSerializer.toString(jdoOid);
+        assertThat(id, is("i~123"));
+        
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
+        
+        // REVIEW: not completely certain if should have the [OID] suffix or not for JDO identity
+        assertThat(oidStr, is("123"+ "[OID]" + Customer.class.getName()));
+    }
+
+
+    @Test
+    public void whenJavaxJdoStringIdentity() throws Exception {
+        Object jdoOid = new javax.jdo.identity.StringIdentity(Customer.class, "123");
+        String id = JdoOidSerializer.toString(jdoOid);
+        assertThat(id, is("s~123"));
+        
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
+        
+        // REVIEW: not completely certain if should have the [OID] suffix or not for JDO identity
+        assertThat(oidStr, is("123" + "[OID]" + Customer.class.getName()));
+    }
 
-    public static class Customer {}
     
     @Test
-    public void whenInt() throws Exception {
-        Object jdoOid = new OIDImpl(Customer.class.getName(), 123);
+    public void whenJavaxJdoLongIdentity() throws Exception {
+        Object jdoOid = new javax.jdo.identity.LongIdentity(Customer.class, 123L);
+        String id = JdoOidSerializer.toString(jdoOid);
+        assertThat(id, is("l~123"));
+        
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
+        
+        // REVIEW: not completely certain if should have the [OID] suffix or not for JDO identity
+        assertThat(oidStr, is("123"+ "[OID]" + Customer.class.getName()));
+    }
+
+
+    @Test
+    public void whenLong() throws Exception {
+        Object jdoOid = new OIDImpl(Customer.class.getName(), 123L);
+        String id = JdoOidSerializer.toString(jdoOid);
+        assertThat(id, is("L~123"));
+        
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
+
+        assertThat(oidStr, is("123"+ "[OID]" + Customer.class.getName()));
+    }
+
+    @Test
+    public void whenDataNucleusOidAndLong() throws Exception {
+        Object jdoOid = new OIDImpl(Customer.class.getName(), 123L);
+        String id = JdoOidSerializer.toString(jdoOid);
+        assertThat(id, is("L~123"));
+        
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
+
+        assertThat(oidStr, is("123"+ "[OID]" + Customer.class.getName()));
+    }
+
+    @Test
+    public void whenDataNucleusOidAndBigInteger() throws Exception {
+        Object jdoOid = new OIDImpl(Customer.class.getName(), new BigInteger("123"));
         String id = JdoOidSerializer.toString(jdoOid);
-        assertThat(id, is("I~123"));
+        assertThat(id, is("B~123"));
+        
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
         
-        String oidStr = JdoOidSerializer.toOidStr(id);
-        assertThat(oidStr, is("123"));
+        assertThat(oidStr, is("123"+ "[OID]" + Customer.class.getName()));
     }
 
     @Test
-    public void whenString() throws Exception {
+    public void whenDataNucleusOidAndString() throws Exception {
         Object jdoOid = new OIDImpl(Customer.class.getName(), "456");
         String id = JdoOidSerializer.toString(jdoOid);
         assertThat(id, is("S~456"));
         
-        String oidStr = JdoOidSerializer.toOidStr(id);
-        assertThat(oidStr, is("456"));
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
+        
+        assertThat(oidStr, is("456" + "[OID]" + Customer.class.getName()));
     }
 
     @Test
-    public void whenOtherKeyValue() throws Exception {
-        Object jdoOid = new OIDImpl(Customer.class.getName(), 789L);
+    public void whenDataNucleusOidAndOtherKeyValue() throws Exception {
+        Date key = new Date();
+		Object jdoOid = new OIDImpl(Customer.class.getName(), key);
         String id = JdoOidSerializer.toString(jdoOid);
-        assertThat(id, IsisMatchers.startsWith(OIDImpl.class.getName() + "~789"));
+        assertThat(id, IsisMatchers.startsWith(OIDImpl.class.getName() + "~" + key.toString()));
         
-        String oidStr = JdoOidSerializer.toOidStr(id);
-        assertThat(oidStr, IsisMatchers.startsWith("789"));
+        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
+        String oidStr = JdoOidSerializer.toOidStr(oid);
+
+        assertThat(oidStr, is(key.toString() + "[OID]" + Customer.class.getName()));
     }
 
 }

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_lazyLoading.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/adaptermgr/Persistence_lazyLoading.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/adaptermgr/Persistence_lazyLoading.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_lazyLoading.java Wed Aug 15 21:15:39 2012
@@ -0,0 +1,85 @@
+/*
+ *  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.adaptermgr;
+
+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_lazyLoading {
+
+    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 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();
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_loadObject.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/adaptermgr/Persistence_loadObject.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/adaptermgr/Persistence_loadObject.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_loadObject.java Wed Aug 15 21:15:39 2012
@@ -0,0 +1,101 @@
+/*
+ *  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.adaptermgr;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+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_loadObject {
+
+    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_using_persistentAdapterFor() 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();
+
+        TypedOid referencingOid2 = (TypedOid) iswf.adapterFor(referencingEntity2).getOid();
+
+        TypedOid referencedOid1 = (TypedOid) iswf.adapterFor(referencedEntity1).getOid();
+        TypedOid referencedOid2 = (TypedOid) iswf.adapterFor(referencedEntity2).getOid();
+
+
+        // when ...
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+
+        ObjectAdapter referencingAdapter2 = iswf.getPersistor().loadObject(referencingOid2);
+        referencingEntity2 = (UnidirReferencingEntity) referencingAdapter2.getObject();
+        
+		UnidirReferencedEntity referenced = referencingEntity2.getReferenced();
+		
+		ObjectAdapter referencedAdapter1 = iswf.getAdapterManager().adapterFor(referencedOid1);
+		assertThat(referenced, is(referencedAdapter1.getObject()));
+
+        // ...switch to refer to other
+
+		ObjectAdapter referencedAdapter2 = iswf.getAdapterManager().adapterFor(referencedOid2);
+		referencedEntity2 = (UnidirReferencedEntity) referencedAdapter2.getObject();
+
+		referencingEntity2.setReferenced(referencedEntity2);
+        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/adaptermgr/Persistence_persistentAdapterFor.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/adaptermgr/Persistence_persistentAdapterFor.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/adaptermgr/Persistence_persistentAdapterFor.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/adaptermgr/Persistence_persistentAdapterFor.java Wed Aug 15 21:15:39 2012
@@ -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.jdo.datanucleus.scenarios.adaptermgr;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+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_persistentAdapterFor {
+
+    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_using_persistentAdapterFor() 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();
+
+        TypedOid referencingOid2 = (TypedOid) iswf.adapterFor(referencingEntity2).getOid();
+
+        TypedOid referencedOid1 = (TypedOid) iswf.adapterFor(referencedEntity1).getOid();
+        TypedOid referencedOid2 = (TypedOid) iswf.adapterFor(referencedEntity2).getOid();
+
+
+        // when ...
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+
+        ObjectAdapter referencingAdapter2 = iswf.getAdapterManager().adapterFor(referencingOid2);
+        referencingEntity2 = (UnidirReferencingEntity) referencingAdapter2.getObject();
+        
+		UnidirReferencedEntity referenced = referencingEntity2.getReferenced();
+		
+		ObjectAdapter referencedAdapter1 = iswf.getAdapterManager().adapterFor(referencedOid1);
+		assertThat(referenced, is(referencedAdapter1.getObject()));
+
+        // ...switch to refer to other
+
+		ObjectAdapter referencedAdapter2 = iswf.getAdapterManager().adapterFor(referencedOid2);
+		referencedEntity2 = (UnidirReferencedEntity) referencedAdapter2.getObject();
+
+		referencingEntity2.setReferenced(referencedEntity2);
+        iswf.commitTran();
+
+        // then...
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+
+        referencingAdapter2 = iswf.getAdapterManager().adapterFor(referencingOid2);
+        referencingEntity2 = (UnidirReferencingEntity) referencingAdapter2.getObject();
+        
+		referenced = referencingEntity2.getReferenced();
+		
+		referencedAdapter2 = iswf.getAdapterManager().adapterFor(referencedOid2);
+		
+        // ...is switched
+		assertThat(referenced, is(referencedAdapter2.getObject()));
+		
+        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_bidirWithListParent.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_bidirWithListParent.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_bidirWithListParent.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_bidirWithListParent.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_bidirWithListParent.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_bidirWithListParent.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_bidirWithListParent.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.refs;
-
-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.refs.BidirWithListChildEntity;
-import org.apache.isis.tck.dom.refs.BidirWithListParentEntity;
-import org.apache.isis.tck.dom.refs.BidirWithListParentEntityRepository;
-
-public class Persistence_persist_bidirWithListParent {
-
-    private BidirWithListParentEntityRepository repo = new BidirWithListParentEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("BIDIRWITHLISTCHILDeNTITY"))
-        .with(Utils.listenerToDeleteFrom("BIDIRWITHLISTPARENTENTITY"))
-        .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<BidirWithListParentEntity> 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();
-        BidirWithListParentEntity 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);
-        List<BidirWithListChildEntity> children = retrievedEntity.getChildren();
-        assertThat(children.size(), is(3));
-        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.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.refs.BidirWithListChildEntity;
+import org.apache.isis.tck.dom.refs.BidirWithListParentEntity;
+import org.apache.isis.tck.dom.refs.BidirWithListParentEntityRepository;
+
+public class Persistence_persist_bidirWithListParent {
+
+    private BidirWithListParentEntityRepository repo = new BidirWithListParentEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("BIDIRWITHLISTCHILDeNTITY"))
+        .with(Utils.listenerToDeleteFrom("BIDIRWITHLISTPARENTENTITY"))
+        .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<BidirWithListParentEntity> 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();
+        BidirWithListParentEntity 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);
+        List<BidirWithListChildEntity> children = retrievedEntity.getChildren();
+        assertThat(children.size(), is(3));
+        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_bidirWithSetParent.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_bidirWithSetParent.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_bidirWithSetParent.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_bidirWithSetParent.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_bidirWithSetParent.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_bidirWithSetParent.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_bidirWithSetParent.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.refs;
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.scenarios.refs;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;

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_polyclass.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_polyclass.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_polyclass.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_polyclass.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_polyclass.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_polyclass.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_polyclass.java Wed Aug 15 21:15:39 2012
@@ -1,94 +1,94 @@
-/*
- *  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;
-
-public class Persistence_persist_polyclass {
-
-    private PolyClassParentEntityRepository repo = new PolyClassParentEntityRepository();
-    
-    @Rule
-    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
-        .with(Utils.listenerToDeleteFrom("POLYCLASSSUBTYPE1ENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYCLASSCHILDENTITY"))
-        .with(Utils.listenerToDeleteFrom("POLYCLASSPARENTENTITY"))
-        .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<PolyClassParentEntity> 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();
-        PolyClassParentEntity 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<PolyClassChildEntity> 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;
+
+public class Persistence_persist_polyclass {
+
+    private PolyClassParentEntityRepository repo = new PolyClassParentEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("POLYCLASSSUBTYPE1ENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYCLASSCHILDENTITY"))
+        .with(Utils.listenerToDeleteFrom("POLYCLASSPARENTENTITY"))
+        .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<PolyClassParentEntity> 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();
+        PolyClassParentEntity 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<PolyClassChildEntity> children = retrievedEntity.getChildren();
+        assertThat(children.size(), is(6));
+        iswf.commitTran();
+    }
+
+    
+
+}



Mime
View raw message