isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject git commit: ISIS-852: updateable derived properties that have just a getter and a modifyXxx() method.
Date Thu, 09 Oct 2014 17:49:44 GMT
Repository: isis
Updated Branches:
  refs/heads/master c1b7b2e2d -> 1b10065e7


ISIS-852: updateable derived properties that have just a getter and a modifyXxx() method.


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

Branch: refs/heads/master
Commit: 1b10065e7fefc591e7e510ecb7a5ea6dba17f485
Parents: c1b7b2e
Author: Dan Haywood <dan@haywood-associates.co.uk>
Authored: Thu Oct 9 18:49:29 2014 +0100
Committer: Dan Haywood <dan@haywood-associates.co.uk>
Committed: Thu Oct 9 18:49:29 2014 +0100

----------------------------------------------------------------------
 .../DisabledFacetOnPropertyInferred.java        | 39 +++++++++++++
 .../DisabledFacetOnPropertyInferredFactory.java | 57 +++++++++++++++++++
 .../update/PropertyModifyFacetFactory.java      |  5 +-
 .../update/PropertySetAndClearFacetFactory.java | 18 +++---
 .../dflt/ProgrammingModelFacetsJava5.java       |  8 ++-
 .../PropertyMethodsFacetFactoryTest.java        | 58 ++++++++++----------
 6 files changed, 145 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/1b10065e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferred.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferred.java
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferred.java
new file mode 100644
index 0000000..8f428a6
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferred.java
@@ -0,0 +1,39 @@
+/*
+ *  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.core.metamodel.facets.properties.disabled.inferred;
+
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAbstract;
+import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
+
+public class DisabledFacetOnPropertyInferred extends DisabledFacetAbstract {
+
+    public DisabledFacetOnPropertyInferred(final ImmutableFacet immutableFacet, final FacetHolder
holder) {
+        super(immutableFacet.when(), Where.ANYWHERE, holder);
+    }
+
+    @Override
+    public String disabledReason(final ObjectAdapter target) {
+        return when().appliesTo(target) ? "Immutable" : null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b10065e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferredFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferredFactory.java
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferredFactory.java
new file mode 100644
index 0000000..29f2241
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/disabled/inferred/DisabledFacetOnPropertyInferredFactory.java
@@ -0,0 +1,57 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.properties.disabled.inferred;
+
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.FacetedMethod;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAlwaysEverywhere;
+import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacet;
+
+/**
+ * Run "near the end"
+ */
+public class DisabledFacetOnPropertyInferredFactory extends FacetFactoryAbstract {
+
+    public DisabledFacetOnPropertyInferredFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+
+        final FacetedMethod property = processMethodContext.getFacetHolder();
+
+        if(property.containsDoOpFacet(DisabledFacet.class)) {
+            // already disabled
+            return;
+        }
+        if(property.containsDoOpFacet(PropertySetterFacet.class)) {
+            // already known to be modifiable
+            return;
+        }
+
+        // else, infer that this is not modifiable
+        FacetUtil.addFacet(new DisabledFacetAlwaysEverywhere(property));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b10065e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertyModifyFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertyModifyFacetFactory.java
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertyModifyFacetFactory.java
index c0f278b..18d8c8c 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertyModifyFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertyModifyFacetFactory.java
@@ -20,16 +20,15 @@
 package org.apache.isis.core.metamodel.facets.properties.update;
 
 import java.lang.reflect.Method;
-
 import org.apache.isis.core.commons.lang.StringExtensions;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacetViaModifyMethod;
-import org.apache.isis.core.metamodel.methodutils.MethodScope;
 import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
 import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacetViaModifyMethod;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
 
 public class PropertyModifyFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1b10065e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
index ebae38d..f29653e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
@@ -20,22 +20,21 @@
 package org.apache.isis.core.metamodel.facets.properties.update;
 
 import java.lang.reflect.Method;
-
 import org.apache.isis.core.commons.lang.StringExtensions;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAlwaysEverywhere;
 import org.apache.isis.core.metamodel.facets.object.notpersistable.NotPersistableFacet;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacetViaClearMethod;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacetViaSetterMethod;
 import org.apache.isis.core.metamodel.facets.properties.update.init.PropertyInitializationFacetViaSetterMethod;
 import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacetViaSetterMethod;
 import org.apache.isis.core.metamodel.methodutils.MethodScope;
-import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAlwaysEverywhere;
 
 public class PropertySetAndClearFacetFactory extends MethodPrefixBasedFacetFactoryAbstract
{
 
@@ -77,7 +76,12 @@ public class PropertySetAndClearFacetFactory extends MethodPrefixBasedFacetFacto
             FacetUtil.addFacet(new PropertyInitializationFacetViaSetterMethod(setMethod,
property));
         } else {
             FacetUtil.addFacet(new NotPersistableFacetInferred(property));
-            FacetUtil.addFacet(new DisabledFacetAlwaysEverywhere(property));
+
+            // previously we also added the DisabledFacetAlwaysEverywhere facet here.
+            // however, the PropertyModifyFacetFactory (which comes next) might install a
PropertySetterFacet instead.
+            // so, have introduced a new facet factory, to be run "near the end", to install
this facet if no
+            // setter facet is found to have been installed.
+
         }
 
         return setMethod;

http://git-wip-us.apache.org/repos/asf/isis/blob/1b10065e/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
index 26acc45..3577d3c 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
@@ -154,6 +154,7 @@ import org.apache.isis.core.metamodel.facets.properties.choices.method.PropertyC
 import org.apache.isis.core.metamodel.facets.properties.defaults.fromtype.PropertyDefaultFacetDerivedFromTypeFactory;
 import org.apache.isis.core.metamodel.facets.properties.defaults.method.PropertyDefaultFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.properties.disabled.fromimmutable.DisabledFacetOnPropertyDerivedFromImmutableFactory;
+import org.apache.isis.core.metamodel.facets.properties.disabled.inferred.DisabledFacetOnPropertyInferredFactory;
 import org.apache.isis.core.metamodel.facets.properties.interaction.PropertyInteractionFacetFactory;
 import org.apache.isis.core.metamodel.facets.properties.mandatory.annotation.mandatory.MandatoryFacetOnPropertyMandatoryAnnotationFactory;
 import org.apache.isis.core.metamodel.facets.properties.mandatory.annotation.optional.MandatoryFacetOnPropertyInvertedByOptionalAnnotationFactory;
@@ -258,9 +259,9 @@ public final class ProgrammingModelFacetsJava5 extends ProgrammingModelAbstract
         // properties
         addFactory(PropertyAccessorFacetViaAccessorFactory.class);
         addFactory(PropertySetAndClearFacetFactory.class);
-        // must come after PropertySetAndClearFacetFactory
+        // must come after PropertySetAndClearFacetFactory (replaces setter facet with modify
if need be)
         addFactory(PropertyModifyFacetFactory.class);
-        
+
         addFactory(PropertyValidateFacetViaMethodFactory.class);
         addFactory(PropertyChoicesFacetViaMethodFactory.class);
         addFactory(PropertyAutoCompleteFacetMethodFactory.class);
@@ -487,6 +488,9 @@ public final class ProgrammingModelFacetsJava5 extends ProgrammingModelAbstract
         addFactory(ValueFacetAnnotationOrConfigurationFactory.class);
 
 
+        // should come near the end, after any facets that install PropertySetterFacet have
run.
+        addFactory(DisabledFacetOnPropertyInferredFactory.class);
+
         //
         // services
         //

http://git-wip-us.apache.org/repos/asf/isis/blob/1b10065e/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
index cfc9b12..7afe6e4 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
@@ -20,62 +20,62 @@
 package org.apache.isis.core.metamodel.facets.properties;
 
 import java.lang.reflect.Method;
-
 import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
 import org.apache.isis.core.metamodel.facets.members.describedas.staticmethod.DescribedAsFacetStaticMethod;
 import org.apache.isis.core.metamodel.facets.members.describedas.staticmethod.DescribedAsFacetStaticMethodFactory;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAlwaysEverywhere;
+import org.apache.isis.core.metamodel.facets.members.disabled.forsession.DisableForSessionFacet;
+import org.apache.isis.core.metamodel.facets.members.disabled.forsession.DisableForSessionFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.members.disabled.forsession.DisableForSessionFacetViaMethodFactory;
+import org.apache.isis.core.metamodel.facets.members.disabled.method.DisableForContextFacet;
+import org.apache.isis.core.metamodel.facets.members.disabled.method.DisableForContextFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.members.disabled.method.DisableForContextFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.members.disabled.staticmethod.DisabledFacetStaticMethodFacetFactory;
+import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAlwaysEverywhere;
+import org.apache.isis.core.metamodel.facets.members.hidden.forsession.HideForSessionFacet;
+import org.apache.isis.core.metamodel.facets.members.hidden.forsession.HideForSessionFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.members.hidden.forsession.HideForSessionFacetViaMethodFactory;
+import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacet;
+import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.members.hidden.staticmethod.HiddenFacetStaticMethodFactory;
 import org.apache.isis.core.metamodel.facets.members.named.staticmethod.NamedFacetStaticMethod;
 import org.apache.isis.core.metamodel.facets.members.named.staticmethod.NamedFacetStaticMethodFactory;
 import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacet;
-import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
-import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
 import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
+import org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessor;
 import org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessorFactory;
 import org.apache.isis.core.metamodel.facets.properties.autocomplete.PropertyAutoCompleteFacet;
 import org.apache.isis.core.metamodel.facets.properties.autocomplete.method.PropertyAutoCompleteFacetMethod;
 import org.apache.isis.core.metamodel.facets.properties.autocomplete.method.PropertyAutoCompleteFacetMethodFactory;
 import org.apache.isis.core.metamodel.facets.properties.choices.PropertyChoicesFacet;
+import org.apache.isis.core.metamodel.facets.properties.choices.method.PropertyChoicesFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.properties.choices.method.PropertyChoicesFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
-import org.apache.isis.core.metamodel.facets.properties.defaults.method.PropertyDefaultFacetViaMethodFactory;
-import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacet;
-import org.apache.isis.core.metamodel.facets.properties.update.init.PropertyInitializationFacet;
-import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacet;
-import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.members.disabled.method.DisableForContextFacet;
-import org.apache.isis.core.metamodel.facets.members.disabled.forsession.DisableForSessionFacet;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
-import org.apache.isis.core.metamodel.facets.members.disabled.forsession.DisableForSessionFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.members.disabled.method.DisableForContextFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAlwaysEverywhere;
-import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacet;
-import org.apache.isis.core.metamodel.facets.members.hidden.forsession.HideForSessionFacet;
-import org.apache.isis.core.metamodel.facets.members.hidden.forsession.HideForSessionFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAlwaysEverywhere;
-import org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessor;
-import org.apache.isis.core.metamodel.facets.properties.choices.method.PropertyChoicesFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.properties.defaults.method.PropertyDefaultFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.properties.defaults.method.PropertyDefaultFacetViaMethodFactory;
+import org.apache.isis.core.metamodel.facets.properties.disabled.inferred.DisabledFacetOnPropertyInferredFactory;
 import org.apache.isis.core.metamodel.facets.properties.update.NotPersistableFacetInferred;
+import org.apache.isis.core.metamodel.facets.properties.update.PropertyModifyFacetFactory;
+import org.apache.isis.core.metamodel.facets.properties.update.PropertySetAndClearFacetFactory;
+import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacet;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacetViaClearMethod;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacetViaSetterMethod;
+import org.apache.isis.core.metamodel.facets.properties.update.init.PropertyInitializationFacet;
 import org.apache.isis.core.metamodel.facets.properties.update.init.PropertyInitializationFacetViaSetterMethod;
-import org.apache.isis.core.metamodel.facets.properties.update.PropertyModifyFacetFactory;
-import org.apache.isis.core.metamodel.facets.properties.update.PropertySetAndClearFacetFactory;
+import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacet;
 import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacetViaModifyMethod;
 import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacetViaSetterMethod;
 import org.apache.isis.core.metamodel.facets.properties.validating.PropertyValidateFacet;
-import org.apache.isis.core.metamodel.facets.properties.validating.method.PropertyValidateFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.properties.validating.method.PropertyValidateFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.properties.validating.method.PropertyValidateFacetViaMethodFactory;
 
 public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
 
@@ -213,11 +213,13 @@ public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest
{
         assertTrue(methodRemover.getRemovedMethodMethodCalls().contains(propertyModifyMethod));
     }
 
-    public void testModifyMethodWithNoSetterStillInstallsDisabledAndDerivedFacets() {
+    public void testModifyMethodWithNoSetterInstallsNotPersistedFacetButDoesNotInstallADisabledFacets()
{
         final PropertySetAndClearFacetFactory facetFactory = new PropertySetAndClearFacetFactory();
         facetFactory.setSpecificationLookup(reflector);
         final PropertyModifyFacetFactory facetFactoryForModify = new PropertyModifyFacetFactory();
         facetFactoryForModify.setSpecificationLookup(reflector);
+        final DisabledFacetOnPropertyInferredFactory disabledFacetOnPropertyInferredFactory
= new DisabledFacetOnPropertyInferredFactory();
+        disabledFacetOnPropertyInferredFactory.setSpecificationLookup(reflector);
 
         class Customer {
             @SuppressWarnings("unused")
@@ -234,14 +236,14 @@ public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest
{
         final ProcessMethodContext processMethodContext = new ProcessMethodContext(Customer.class,
null, null, propertyAccessorMethod, methodRemover, facetedMethod);
         facetFactory.process(processMethodContext);
         facetFactoryForModify.process(processMethodContext);
+        disabledFacetOnPropertyInferredFactory.process(processMethodContext);
 
         Facet facet = facetedMethod.getFacet(NotPersistedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NotPersistableFacetInferred);
 
         facet = facetedMethod.getFacet(DisabledFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof DisabledFacetAlwaysEverywhere);
+        assertNull(facet);
     }
 
     public void testIfHaveSetterAndModifyFacetThenTheModifyFacetWinsOut() {


Mime
View raw message