incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1059826 [4/8] - in /incubator/isis/trunk: alternatives/objectstore/sql/persistor/src/main/java/org/apache/isis/alternatives/objectstore/sql/auto/ alternatives/progmodel/groovy/metamodel/src/main/java/org/apache/isis/progmodel/groovy/metamo...
Date Mon, 17 Jan 2011 09:27:01 GMT
Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -25,9 +25,13 @@ import java.util.List;
 
 import org.apache.isis.applib.annotation.Prototype;
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
 import org.apache.isis.core.metamodel.facets.actions.prototype.PrototypeFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.actions.prototype.annotation.PrototypeAnnotationFacetFactory;
 
 
 public class PrototypeAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -66,9 +70,9 @@ public class PrototypeAnnotationFacetFac
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PrototypeFacet.class);
+        final Facet facet = facetedMethod.getFacet(PrototypeFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PrototypeFacetAbstract);
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/CollectionFieldMethodsFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/CollectionFieldMethodsFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/CollectionFieldMethodsFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/CollectionFieldMethodsFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -28,6 +28,7 @@ import java.util.Set;
 import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
 import org.apache.isis.core.metamodel.facets.When;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionAddToFacet;
@@ -36,52 +37,51 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.hide.HiddenFacet;
 import org.apache.isis.core.metamodel.facets.naming.describedas.DescribedAsFacet;
 import org.apache.isis.core.metamodel.facets.naming.named.NamedFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.access.PropertyAccessorFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.access.PropertyOrCollectionAccessorFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.actcoll.typeof.TypeOfFacetInferredFromSupportingMethods;
-import org.apache.isis.core.progmodel.facets.actions.DescribedAsFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.actions.NamedFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.collections.accessor.CollectionAccessorFacetFactory;
+import org.apache.isis.core.progmodel.facets.collections.clear.CollectionClearFacetFactory;
+import org.apache.isis.core.progmodel.facets.collections.clear.CollectionClearFacetViaAccessor;
+import org.apache.isis.core.progmodel.facets.collections.clear.CollectionClearFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.collections.modify.CollectionAddRemoveAndValidateFacetFactory;
 import org.apache.isis.core.progmodel.facets.collections.modify.CollectionAddToFacetViaAccessor;
 import org.apache.isis.core.progmodel.facets.collections.modify.CollectionAddToFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.collections.modify.CollectionClearFacetViaAccessor;
-import org.apache.isis.core.progmodel.facets.collections.modify.CollectionClearFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.collections.modify.CollectionRemoveFromFacetViaAccessor;
 import org.apache.isis.core.progmodel.facets.collections.modify.CollectionRemoveFromFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.collections.validate.CollectionValidateAddToFacet;
 import org.apache.isis.core.progmodel.facets.collections.validate.CollectionValidateAddToFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.collections.validate.CollectionValidateRemoveFromFacet;
 import org.apache.isis.core.progmodel.facets.collections.validate.CollectionValidateRemoveFromFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.disable.DisableForSessionFacet;
-import org.apache.isis.core.progmodel.facets.disable.DisableForSessionFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.disable.DisabledFacet;
-import org.apache.isis.core.progmodel.facets.disable.DisabledFacetAlways;
-import org.apache.isis.core.progmodel.facets.hide.HiddenFacetAbstract;
-import org.apache.isis.core.progmodel.facets.hide.HiddenFacetAlways;
-import org.apache.isis.core.progmodel.facets.hide.HideForSessionFacet;
-import org.apache.isis.core.progmodel.facets.hide.HideForSessionFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.propcoll.access.PropertyAccessorFacetViaAccessor;
+import org.apache.isis.core.progmodel.facets.members.describedas.staticmethod.DescribedAsFacetViaDescriptionMethodFacetFactory;
+import org.apache.isis.core.progmodel.facets.members.describedas.staticmethod.DescribedAsFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.members.disable.DisableForSessionFacet;
+import org.apache.isis.core.progmodel.facets.members.disable.DisabledFacet;
+import org.apache.isis.core.progmodel.facets.members.disable.forsession.DisableForSessionFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.members.disable.forsession.DisabledFacetViaDisableForSessionMethodFacetFactory;
+import org.apache.isis.core.progmodel.facets.members.disable.staticmethod.DisabledFacetAlways;
+import org.apache.isis.core.progmodel.facets.members.disable.staticmethod.DisabledFacetViaProtectMethodFacetFactory;
+import org.apache.isis.core.progmodel.facets.members.hide.HiddenFacetAbstract;
+import org.apache.isis.core.progmodel.facets.members.hide.HideForSessionFacet;
+import org.apache.isis.core.progmodel.facets.members.hide.forsession.HiddenFacetViaHideForSessionMethodFacetFactory;
+import org.apache.isis.core.progmodel.facets.members.hide.forsession.HideForSessionFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.members.hide.staticmethod.HiddenFacetAlways;
+import org.apache.isis.core.progmodel.facets.members.hide.staticmethod.HiddenFacetViaAlwaysHideMethodFacetFactory;
+import org.apache.isis.core.progmodel.facets.members.name.staticmethod.NamedFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.members.name.staticmethod.NamedFacetViaNameMethodFacetFactory;
+import org.apache.isis.core.progmodel.facets.properties.accessor.PropertyOrCollectionAccessorFacetViaAccessor;
 
 
 public class CollectionFieldMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
 
-    private CollectionFieldMethodsFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new CollectionFieldMethodsFacetFactory();
-        facetFactory.setSpecificationLookup(reflector);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
+
+    /**
+     * TODO: should do for other Collection*FacetFactory's also.
+     */
     @Override
     public void testFeatureTypes() {
+        CollectionAccessorFacetFactory facetFactory = new CollectionAccessorFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
         final List<FeatureType> featureTypes = facetFactory.getFeatureTypes();
         assertFalse(contains(featureTypes, FeatureType.OBJECT));
         assertFalse(contains(featureTypes, FeatureType.PROPERTY));
@@ -91,111 +91,135 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testPropertyAccessorFacetIsInstalledForJavaUtilCollectionAndMethodRemoved() {
+        CollectionAccessorFacetFactory facetFactory = new CollectionAccessorFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+        
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings({ "rawtypes", "unused" })
             public Collection getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PropertyAccessorFacet.class);
+        final Facet facet = facetedMethod.getFacet(PropertyOrCollectionAccessorFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof PropertyAccessorFacetViaAccessor);
-        final PropertyAccessorFacetViaAccessor propertyAccessorFacetViaAccessor = (PropertyAccessorFacetViaAccessor) facet;
-        assertEquals(collectionAccessorMethod, propertyAccessorFacetViaAccessor.getMethods().get(0));
+        assertTrue(facet instanceof PropertyOrCollectionAccessorFacetViaAccessor);
+        final PropertyOrCollectionAccessorFacetViaAccessor propertyOrCollectionAccessorFacetViaAccessor = (PropertyOrCollectionAccessorFacetViaAccessor) facet;
+        assertEquals(collectionAccessorMethod, propertyOrCollectionAccessorFacetViaAccessor.getMethods().get(0));
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(collectionAccessorMethod));
     }
 
     public void testPropertyAccessorFacetIsInstalledForJavaUtilListAndMethodRemoved() {
+        CollectionAccessorFacetFactory facetFactory = new CollectionAccessorFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings({ "rawtypes", "unused" })
             public List getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PropertyAccessorFacet.class);
+        final Facet facet = facetedMethod.getFacet(PropertyOrCollectionAccessorFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof PropertyAccessorFacetViaAccessor);
-        final PropertyAccessorFacetViaAccessor propertyAccessorFacetViaAccessor = (PropertyAccessorFacetViaAccessor) facet;
-        assertEquals(collectionAccessorMethod, propertyAccessorFacetViaAccessor.getMethods().get(0));
+        assertTrue(facet instanceof PropertyOrCollectionAccessorFacetViaAccessor);
+        final PropertyOrCollectionAccessorFacetViaAccessor propertyOrCollectionAccessorFacetViaAccessor = (PropertyOrCollectionAccessorFacetViaAccessor) facet;
+        assertEquals(collectionAccessorMethod, propertyOrCollectionAccessorFacetViaAccessor.getMethods().get(0));
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(collectionAccessorMethod));
     }
 
-    public void testPropertyAccessorFacetIsInstalledForJavaUtilSetAndMethodRemoved() {
+    public void testPropertyAccessorFacetIsInstalledForJavaUtilSetAndMethodRemoved() {
+        CollectionAccessorFacetFactory facetFactory = new CollectionAccessorFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings({ "rawtypes", "unused" })
             public Set getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PropertyAccessorFacet.class);
+        final Facet facet = facetedMethod.getFacet(PropertyOrCollectionAccessorFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof PropertyAccessorFacetViaAccessor);
-        final PropertyAccessorFacetViaAccessor propertyAccessorFacetViaAccessor = (PropertyAccessorFacetViaAccessor) facet;
-        assertEquals(collectionAccessorMethod, propertyAccessorFacetViaAccessor.getMethods().get(0));
+        assertTrue(facet instanceof PropertyOrCollectionAccessorFacetViaAccessor);
+        final PropertyOrCollectionAccessorFacetViaAccessor propertyOrCollectionAccessorFacetViaAccessor = (PropertyOrCollectionAccessorFacetViaAccessor) facet;
+        assertEquals(collectionAccessorMethod, propertyOrCollectionAccessorFacetViaAccessor.getMethods().get(0));
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(collectionAccessorMethod));
     }
 
-    public void testPropertyAccessorFacetIsInstalledForObjectArrayAndMethodRemoved() {
+    public void testPropertyAccessorFacetIsInstalledForObjectArrayAndMethodRemoved() {
+        CollectionAccessorFacetFactory facetFactory = new CollectionAccessorFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public Object[] getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PropertyAccessorFacet.class);
+        final Facet facet = facetedMethod.getFacet(PropertyOrCollectionAccessorFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof PropertyAccessorFacetViaAccessor);
-        final PropertyAccessorFacetViaAccessor propertyAccessorFacetViaAccessor = (PropertyAccessorFacetViaAccessor) facet;
-        assertEquals(collectionAccessorMethod, propertyAccessorFacetViaAccessor.getMethods().get(0));
+        assertTrue(facet instanceof PropertyOrCollectionAccessorFacetViaAccessor);
+        final PropertyOrCollectionAccessorFacetViaAccessor propertyOrCollectionAccessorFacetViaAccessor = (PropertyOrCollectionAccessorFacetViaAccessor) facet;
+        assertEquals(collectionAccessorMethod, propertyOrCollectionAccessorFacetViaAccessor.getMethods().get(0));
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(collectionAccessorMethod));
     }
 
-    public void testPropertyAccessorFacetIsInstalledForOrderArrayAndMethodRemoved() {
+    public void testPropertyAccessorFacetIsInstalledForOrderArrayAndMethodRemoved() {
+        CollectionAccessorFacetFactory facetFactory = new CollectionAccessorFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public Order[] getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PropertyAccessorFacet.class);
+        final Facet facet = facetedMethod.getFacet(PropertyOrCollectionAccessorFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof PropertyAccessorFacetViaAccessor);
-        final PropertyAccessorFacetViaAccessor propertyAccessorFacetViaAccessor = (PropertyAccessorFacetViaAccessor) facet;
-        assertEquals(collectionAccessorMethod, propertyAccessorFacetViaAccessor.getMethods().get(0));
+        assertTrue(facet instanceof PropertyOrCollectionAccessorFacetViaAccessor);
+        final PropertyOrCollectionAccessorFacetViaAccessor propertyOrCollectionAccessorFacetViaAccessor = (PropertyOrCollectionAccessorFacetViaAccessor) facet;
+        assertEquals(collectionAccessorMethod, propertyOrCollectionAccessorFacetViaAccessor.getMethods().get(0));
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(collectionAccessorMethod));
     }
 
-    public void testAddToFacetIsInstalledViaAccessorIfNoExplicitAddToMethodExists() {
+    public void testAddToFacetIsInstalledViaAccessorIfNoExplicitAddToMethodExists() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         class Customer {
+            @SuppressWarnings("unused")
             @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
             public Collection<Order> getOrders() {
                 return null;
@@ -203,9 +227,9 @@ public class CollectionFieldMethodsFacet
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionAddToFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionAddToFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionAddToFacetViaAccessor);
         final CollectionAddToFacetViaAccessor collectionAddToFacetViaAccessor = (CollectionAddToFacetViaAccessor) facet;
@@ -213,35 +237,43 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testCannotInferTypeOfFacetIfNoExplicitAddToOrRemoveFromMethods() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order{}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public Collection<Order> getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        assertNull(facetHolder.getFacet(TypeOfFacet.class));
+        assertNull(facetedMethod.getFacet(TypeOfFacet.class));
     }
 
     public void testRemoveFromFacetIsInstalledViaAccessorIfNoExplicitRemoveFromMethodExists() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order{}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public Collection<Order> getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionRemoveFromFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionRemoveFromFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionRemoveFromFacetViaAccessor);
         final CollectionRemoveFromFacetViaAccessor collectionRemoveFromFacetViaAccessor = (CollectionRemoveFromFacetViaAccessor) facet;
@@ -249,6 +281,9 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testAddToFacetIsInstalledAndMethodRemoved() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
@@ -264,9 +299,9 @@ public class CollectionFieldMethodsFacet
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
         final Method addToMethod = findMethod(Customer.class, "addToOrders", new Class[] { Order.class });
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionAddToFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionAddToFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionAddToFacetViaMethod);
         final CollectionAddToFacetViaMethod collectionAddToFacetViaMethod = (CollectionAddToFacetViaMethod) facet;
@@ -276,6 +311,9 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testCanInferTypeOfFacetFromExplicitAddToMethod() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
@@ -290,9 +328,9 @@ public class CollectionFieldMethodsFacet
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(TypeOfFacet.class);
+        final Facet facet = facetedMethod.getFacet(TypeOfFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof TypeOfFacetInferredFromSupportingMethods);
         final TypeOfFacetInferredFromSupportingMethods typeOfFacetInferredFromSupportingMethods = (TypeOfFacetInferredFromSupportingMethods) facet;
@@ -300,22 +338,27 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testRemoveFromFacetIsInstalledAndMethodRemoved() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings({ "rawtypes", "unused" })
             public Collection getOrders() {
                 return null;
             }
 
+            @SuppressWarnings("unused")
             public void removeFromOrders(final Order o) {};
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
         final Method removeFromMethod = findMethod(Customer.class, "removeFromOrders", new Class[] { Order.class });
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionRemoveFromFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionRemoveFromFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionRemoveFromFacetViaMethod);
         final CollectionRemoveFromFacetViaMethod collectionRemoveFromFacetViaMethod = (CollectionRemoveFromFacetViaMethod) facet;
@@ -325,6 +368,9 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testCanInferTypeOfFacetFromExplicitRemoveFromMethod() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
@@ -338,9 +384,9 @@ public class CollectionFieldMethodsFacet
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(TypeOfFacet.class);
+        final Facet facet = facetedMethod.getFacet(TypeOfFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof TypeOfFacetInferredFromSupportingMethods);
         final TypeOfFacetInferredFromSupportingMethods typeOfFacetInferredFromSupportingMethods = (TypeOfFacetInferredFromSupportingMethods) facet;
@@ -348,22 +394,27 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testClearFacetIsInstalledAndMethodRemoved() {
-        @SuppressWarnings("hiding")
+        CollectionClearFacetFactory facetFactory = new CollectionClearFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
+        @SuppressWarnings({ "hiding", "unused" })
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings({ "rawtypes", "unused" })
             public Collection getOrders() {
                 return null;
             }
 
+            @SuppressWarnings("unused")
             public void clearOrders() {};
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
         final Method clearMethod = findMethod(Customer.class, "clearOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionClearFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionClearFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionClearFacetViaMethod);
         final CollectionClearFacetViaMethod collectionClearFacetViaMethod = (CollectionClearFacetViaMethod) facet;
@@ -373,36 +424,46 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testClearFacetIsInstalledViaAccessorIfNoExplicitClearMethod() {
-        @SuppressWarnings("hiding")
+        CollectionClearFacetFactory facetFactory = new CollectionClearFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+        
+        @SuppressWarnings({ "hiding", "unused" })
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings({ "rawtypes", "unused" })
             public Collection getOrders() {
                 return null;
             }
         }
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionClearFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionClearFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionClearFacetViaAccessor);
         final CollectionClearFacetViaAccessor collectionClearFacetViaAccessor = (CollectionClearFacetViaAccessor) facet;
         assertEquals(collectionAccessorMethod, collectionClearFacetViaAccessor.getMethods().get(0));
     }
 
-    public void testValidateAddToFacetIsInstalledAndMethodRemoved() {
+    public void testValidateAddToFacetIsInstalledAndMethodRemoved() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+        
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings({ "rawtypes", "unused" })
             public Collection getOrders() {
                 return null;
             }
 
+            @SuppressWarnings("unused")
             public void addToOrders(final Order o) {};
 
+            @SuppressWarnings("unused")
             public String validateAddToOrders(final Order o) {
                 return null;
             };
@@ -410,9 +471,9 @@ public class CollectionFieldMethodsFacet
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
         final Method validateAddToMethod = findMethod(Customer.class, "validateAddToOrders", new Class[] { Order.class });
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionValidateAddToFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionValidateAddToFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionValidateAddToFacetViaMethod);
         final CollectionValidateAddToFacetViaMethod collectionValidateAddToFacetViaMethod = (CollectionValidateAddToFacetViaMethod) facet;
@@ -422,16 +483,22 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testValidateRemoveFromFacetIsInstalledAndMethodRemoved() {
+        CollectionAddRemoveAndValidateFacetFactory facetFactory = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public Collection<Order> getOrders() {
                 return null;
             }
 
+            @SuppressWarnings("unused")
             public void removeFromOrders(final Order o) {};
 
+            @SuppressWarnings("unused")
             public String validateRemoveFromOrders(final Order o) {
                 return null;
             };
@@ -440,9 +507,9 @@ public class CollectionFieldMethodsFacet
         final Method validateRemoveFromMethod = findMethod(Customer.class, "validateRemoveFromOrders",
                 new Class[] { Order.class });
 
-        facetFactory.process(Customer.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionValidateRemoveFromFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionValidateRemoveFromFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionValidateRemoveFromFacetViaMethod);
         final CollectionValidateRemoveFromFacetViaMethod collectionValidateRemoveFromFacetViaMethod = (CollectionValidateRemoveFromFacetViaMethod) facet;
@@ -452,10 +519,14 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testMethodFoundInSuperclass() {
+        CollectionAccessorFacetFactory facetFactory = new CollectionAccessorFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public Collection<Order> getOrders() {
                 return null;
             }
@@ -467,16 +538,21 @@ public class CollectionFieldMethodsFacet
 
         final Method collectionAccessorMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(CustomerEx.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerEx.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PropertyAccessorFacet.class);
+        final Facet facet = facetedMethod.getFacet(PropertyOrCollectionAccessorFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof PropertyAccessorFacetViaAccessor);
-        final PropertyAccessorFacetViaAccessor collectionAccessorFacetViaMethod = (PropertyAccessorFacetViaAccessor) facet;
+        assertTrue(facet instanceof PropertyOrCollectionAccessorFacetViaAccessor);
+        final PropertyOrCollectionAccessorFacetViaAccessor collectionAccessorFacetViaMethod = (PropertyOrCollectionAccessorFacetViaAccessor) facet;
         assertEquals(collectionAccessorMethod, collectionAccessorFacetViaMethod.getMethods().get(0));
     }
 
     public void testMethodFoundInSuperclassButHelpeMethodsFoundInSubclasses() {
+        CollectionAccessorFacetFactory facetFactoryForAccessor = new CollectionAccessorFacetFactory();
+        facetFactoryForAccessor.setSpecificationLookup(reflector);
+        CollectionAddRemoveAndValidateFacetFactory facetFactoryForHelpers = new CollectionAddRemoveAndValidateFacetFactory();
+        facetFactoryForHelpers.setSpecificationLookup(reflector);
+
         @SuppressWarnings("hiding")
         class Order {}
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
@@ -505,9 +581,10 @@ public class CollectionFieldMethodsFacet
         final Method validateRemoveFromMethod = findMethod(CustomerEx.class, "validateRemoveFromOrders",
                 new Class[] { Order.class });
 
-        facetFactory.process(CustomerEx.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactoryForAccessor.process(new ProcessMethodContext(CustomerEx.class, collectionAccessorMethod, methodRemover, facetedMethod));
+        facetFactoryForHelpers.process(new ProcessMethodContext(CustomerEx.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CollectionRemoveFromFacet.class);
+        final Facet facet = facetedMethod.getFacet(CollectionRemoveFromFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CollectionRemoveFromFacetViaMethod);
         final CollectionRemoveFromFacetViaMethod collectionRemoveFromFacetViaMethod = (CollectionRemoveFromFacetViaMethod) facet;
@@ -515,7 +592,7 @@ public class CollectionFieldMethodsFacet
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(removeFromMethod));
 
-        final Facet facet1 = facetHolder.getFacet(CollectionValidateRemoveFromFacet.class);
+        final Facet facet1 = facetedMethod.getFacet(CollectionValidateRemoveFromFacet.class);
         assertNotNull(facet1);
         assertTrue(facet1 instanceof CollectionValidateRemoveFromFacetViaMethod);
         final CollectionValidateRemoveFromFacetViaMethod collectionValidateRemoveFromFacetViaMethod = (CollectionValidateRemoveFromFacetViaMethod) facet1;
@@ -567,12 +644,15 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testInstallsNamedFacetUsingNameMethodAndRemovesMethod() {
+        NamedFacetViaNameMethodFacetFactory facetFactory = new NamedFacetViaNameMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOrders");
         final Method nameMethod = findMethod(CustomerStatic.class, "nameOrders");
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NamedFacet.class);
+        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NamedFacetViaMethod);
         final NamedFacetViaMethod namedFacet = (NamedFacetViaMethod) facet;
@@ -582,12 +662,15 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testInstallsDescribedAsFacetUsingDescriptionAndRemovesMethod() {
+        DescribedAsFacetViaDescriptionMethodFacetFactory facetFactory = new DescribedAsFacetViaDescriptionMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+        
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOrders");
         final Method descriptionMethod = findMethod(CustomerStatic.class, "descriptionOrders");
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DescribedAsFacet.class);
+        final Facet facet = facetedMethod.getFacet(DescribedAsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DescribedAsFacetViaMethod);
         final DescribedAsFacetViaMethod describedAsFacet = (DescribedAsFacetViaMethod) facet;
@@ -597,12 +680,15 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testInstallsHiddenFacetUsingAlwaysHideAndRemovesMethod() {
+        HiddenFacetViaAlwaysHideMethodFacetFactory facetFactory = new HiddenFacetViaAlwaysHideMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOrders");
         final Method alwaysHideMethod = findMethod(CustomerStatic.class, "alwaysHideOrders");
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof HiddenFacetAlways);
         final HiddenFacetAbstract hiddenFacetAlways = (HiddenFacetAlways) facet;
@@ -612,24 +698,29 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testInstallsHiddenFacetUsingAlwaysHideWhenNotAndRemovesMethod() {
+        HiddenFacetViaAlwaysHideMethodFacetFactory facetFactory = new HiddenFacetViaAlwaysHideMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOtherOrders");
         final Method alwaysHideMethod = findMethod(CustomerStatic.class, "alwaysHideOtherOrders");
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        assertNull(facetHolder.getFacet(HiddenFacet.class));
+        assertNull(facetedMethod.getFacet(HiddenFacet.class));
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(alwaysHideMethod));
     }
 
     public void testInstallsDisabledFacetUsingProtectAndRemovesMethod() {
+        DisabledFacetViaProtectMethodFacetFactory facetFactory = new DisabledFacetViaProtectMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOrders");
         final Method protectMethod = findMethod(CustomerStatic.class, "protectOrders");
-        // reflector.setLoadSpecificationClassReturn(voidNoSpec);
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DisabledFacetAlways);
         final DisabledFacetAlways disabledFacetAlways = (DisabledFacetAlways) facet;
@@ -639,23 +730,29 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testDoesNotInstallDisabledFacetUsingProtectWhenNotAndRemovesMethod() {
+        DisabledFacetViaProtectMethodFacetFactory facetFactory = new DisabledFacetViaProtectMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOtherOrders");
         final Method protectMethod = findMethod(CustomerStatic.class, "protectOtherOrders");
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        assertNull(facetHolder.getFacet(DisabledFacet.class));
+        assertNull(facetedMethod.getFacet(DisabledFacet.class));
 
         assertTrue(methodRemover.getRemoveMethodMethodCalls().contains(protectMethod));
     }
 
     public void testInstallsHiddenForSessionFacetAndRemovesMethod() {
+        HiddenFacetViaHideForSessionMethodFacetFactory facetFactory = new HiddenFacetViaHideForSessionMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+        
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOrders");
         final Method hideMethod = findMethod(CustomerStatic.class, "hideOrders", new Class[] { UserMemento.class });
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HideForSessionFacet.class);
+        final Facet facet = facetedMethod.getFacet(HideForSessionFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof HideForSessionFacetViaMethod);
         final HideForSessionFacetViaMethod hideForSessionFacetViaMethod = (HideForSessionFacetViaMethod) facet;
@@ -665,12 +762,15 @@ public class CollectionFieldMethodsFacet
     }
 
     public void testInstallsDisabledForSessionFacetAndRemovesMethod() {
+        DisabledFacetViaDisableForSessionMethodFacetFactory facetFactory = new DisabledFacetViaDisableForSessionMethodFacetFactory();
+        facetFactory.setSpecificationLookup(reflector);
+
         final Method collectionAccessorMethod = findMethod(CustomerStatic.class, "getOrders");
         final Method disableMethod = findMethod(CustomerStatic.class, "disableOrders", new Class[] { UserMemento.class });
 
-        facetFactory.process(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(CustomerStatic.class, collectionAccessorMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisableForSessionFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisableForSessionFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DisableForSessionFacetViaMethod);
         final DisableForSessionFacetViaMethod disableForSessionFacetViaMethod = (DisableForSessionFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/JavaCollectionFacetTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/JavaCollectionFacetTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/JavaCollectionFacetTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/JavaCollectionFacetTest.java Mon Jan 17 09:26:54 2011
@@ -39,6 +39,7 @@ import org.junit.runner.RunWith;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.collections.collection.JavaCollectionFacet;
 
 
 @RunWith(JMock.class)

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/disable/DisabledAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/disable/DisabledAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/disable/DisabledAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/disable/DisabledAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -27,8 +27,14 @@ import java.util.List;
 import org.apache.isis.applib.annotation.Disabled;
 import org.apache.isis.applib.annotation.When;
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.members.disable.DisabledFacet;
+import org.apache.isis.core.progmodel.facets.members.disable.DisabledFacetAbstract;
+import org.apache.isis.core.progmodel.facets.members.disable.annotation.DisabledAnnotationFacetFactory;
 
 
 public class DisabledAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -68,9 +74,9 @@ public class DisabledAnnotationFacetFact
         }
         final Method actionMethod = findMethod(Customer.class, "getNumberOfOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DisabledFacetAbstract);
 
@@ -87,9 +93,9 @@ public class DisabledAnnotationFacetFact
         }
         final Method actionMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DisabledFacetAbstract);
 
@@ -104,9 +110,9 @@ public class DisabledAnnotationFacetFact
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DisabledFacetAbstract);
 
@@ -121,9 +127,9 @@ public class DisabledAnnotationFacetFact
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         final DisabledFacetAbstract disabledFacetAbstract = (DisabledFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.ALWAYS, disabledFacetAbstract.value());
@@ -137,9 +143,9 @@ public class DisabledAnnotationFacetFact
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         final DisabledFacetAbstract disabledFacetAbstract = (DisabledFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.NEVER, disabledFacetAbstract.value());
@@ -153,9 +159,9 @@ public class DisabledAnnotationFacetFact
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         final DisabledFacetAbstract disabledFacetAbstract = (DisabledFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.ONCE_PERSISTED, disabledFacetAbstract.value());
@@ -170,9 +176,9 @@ public class DisabledAnnotationFacetFact
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DisabledFacet.class);
+        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
         final DisabledFacetAbstract disabledFacetAbstract = (DisabledFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.UNTIL_PERSISTED, disabledFacetAbstract.value());

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/hide/HiddenAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/hide/HiddenAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/hide/HiddenAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/hide/HiddenAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -27,9 +27,14 @@ import java.util.List;
 import org.apache.isis.applib.annotation.Hidden;
 import org.apache.isis.applib.annotation.When;
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
 import org.apache.isis.core.metamodel.facets.hide.HiddenFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.members.hide.HiddenFacetAbstract;
+import org.apache.isis.core.progmodel.facets.members.hide.annotation.HiddenAnnotationFacetFactory;
 
 
 public class HiddenAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -69,9 +74,9 @@ public class HiddenAnnotationFacetFactor
         }
         final Method actionMethod = findMethod(Customer.class, "getNumberOfOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof HiddenFacetAbstract);
 
@@ -88,9 +93,9 @@ public class HiddenAnnotationFacetFactor
         }
         final Method actionMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof HiddenFacetAbstract);
 
@@ -105,9 +110,9 @@ public class HiddenAnnotationFacetFactor
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof HiddenFacetAbstract);
 
@@ -122,9 +127,9 @@ public class HiddenAnnotationFacetFactor
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         final HiddenFacetAbstract hiddenFacetAbstract = (HiddenFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.ALWAYS, hiddenFacetAbstract.value());
@@ -138,9 +143,9 @@ public class HiddenAnnotationFacetFactor
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         final HiddenFacetAbstract hiddenFacetAbstract = (HiddenFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.NEVER, hiddenFacetAbstract.value());
@@ -154,9 +159,9 @@ public class HiddenAnnotationFacetFactor
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         final HiddenFacetAbstract hiddenFacetAbstract = (HiddenFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.ONCE_PERSISTED, hiddenFacetAbstract.value());
@@ -170,9 +175,9 @@ public class HiddenAnnotationFacetFactor
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(HiddenFacet.class);
+        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
         final HiddenFacetAbstract hiddenFacetAbstract = (HiddenFacetAbstract) facet;
 
         assertEquals(org.apache.isis.core.metamodel.facets.When.UNTIL_PERSISTED, hiddenFacetAbstract.value());

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/describedas/DescribedAsAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/describedas/DescribedAsAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/describedas/DescribedAsAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/describedas/DescribedAsAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -27,9 +27,13 @@ import java.util.List;
 import org.apache.isis.applib.annotation.DescribedAs;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessParameterContext;
 import org.apache.isis.core.metamodel.facets.naming.describedas.DescribedAsFacet;
 import org.apache.isis.core.metamodel.facets.naming.describedas.DescribedAsFacetAbstract;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.describedas.annotation.DescribedAsAnnotationFacetFactory;
 
 
 public class DescribedAsAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -63,9 +67,9 @@ public class DescribedAsAnnotationFacetF
         @DescribedAs("some description")
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DescribedAsFacet.class);
+        final Facet facet = facetedMethod.getFacet(DescribedAsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DescribedAsFacetAbstract);
         final DescribedAsFacetAbstract describedAsFacetAbstract = (DescribedAsFacetAbstract) facet;
@@ -84,9 +88,9 @@ public class DescribedAsAnnotationFacetF
         }
         final Method actionMethod = findMethod(Customer.class, "getNumberOfOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DescribedAsFacet.class);
+        final Facet facet = facetedMethod.getFacet(DescribedAsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DescribedAsFacetAbstract);
         final DescribedAsFacetAbstract describedAsFacetAbstract = (DescribedAsFacetAbstract) facet;
@@ -105,9 +109,9 @@ public class DescribedAsAnnotationFacetF
         }
         final Method actionMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DescribedAsFacet.class);
+        final Facet facet = facetedMethod.getFacet(DescribedAsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DescribedAsFacetAbstract);
         final DescribedAsFacetAbstract describedAsFacetAbstract = (DescribedAsFacetAbstract) facet;
@@ -124,9 +128,9 @@ public class DescribedAsAnnotationFacetF
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(DescribedAsFacet.class);
+        final Facet facet = facetedMethod.getFacet(DescribedAsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DescribedAsFacetAbstract);
         final DescribedAsFacetAbstract describedAsFacetAbstract = (DescribedAsFacetAbstract) facet;
@@ -138,13 +142,14 @@ public class DescribedAsAnnotationFacetF
     public void testDescribedAsAnnotationPickedUpOnActionParameter() {
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public void someAction(@DescribedAs("some description") final int x) {}
         }
         final Method actionMethod = findMethod(Customer.class, "someAction", new Class[] { int.class });
 
-        facetFactory.processParams(actionMethod, 0, facetHolder);
+        facetFactory.processParams(new ProcessParameterContext(actionMethod, 0, facetedMethodParameter));
 
-        final Facet facet = facetHolder.getFacet(DescribedAsFacet.class);
+        final Facet facet = facetedMethodParameter.getFacet(DescribedAsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DescribedAsFacetAbstract);
         final DescribedAsFacetAbstract describedAsFacetAbstract = (DescribedAsFacetAbstract) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/named/NamedAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/named/NamedAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/named/NamedAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/naming/named/NamedAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -27,9 +27,13 @@ import java.util.List;
 import org.apache.isis.applib.annotation.Named;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessParameterContext;
 import org.apache.isis.core.metamodel.facets.naming.named.NamedFacet;
 import org.apache.isis.core.metamodel.facets.naming.named.NamedFacetAbstract;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.named.annotation.NamedAnnotationFacetFactory;
 
 
 public class NamedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -62,9 +66,9 @@ public class NamedAnnotationFacetFactory
     public void testNamedAnnotationPickedUpOnClass() {
         @Named("some name")
         class Customer {}
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NamedFacet.class);
+        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NamedFacetAbstract);
         final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
@@ -83,9 +87,9 @@ public class NamedAnnotationFacetFactory
         }
         final Method actionMethod = findMethod(Customer.class, "getNumberOfOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NamedFacet.class);
+        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NamedFacetAbstract);
         final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
@@ -104,9 +108,9 @@ public class NamedAnnotationFacetFactory
         }
         final Method actionMethod = findMethod(Customer.class, "getOrders");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NamedFacet.class);
+        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NamedFacetAbstract);
         final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
@@ -123,9 +127,9 @@ public class NamedAnnotationFacetFactory
         }
         final Method actionMethod = findMethod(Customer.class, "someAction");
 
-        facetFactory.process(Customer.class, actionMethod, methodRemover, facetHolder);
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NamedFacet.class);
+        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NamedFacetAbstract);
         final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
@@ -137,13 +141,14 @@ public class NamedAnnotationFacetFactory
     public void testNamedAnnotationPickedUpOnActionParameter() {
         @edu.umd.cs.findbugs.annotations.SuppressWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
         class Customer {
+            @SuppressWarnings("unused")
             public void someAction(@Named("some name") final int x) {}
         }
         final Method actionMethod = findMethod(Customer.class, "someAction", new Class[] { int.class });
 
-        facetFactory.processParams(actionMethod, 0, facetHolder);
+        facetFactory.processParams(new ProcessParameterContext(actionMethod, 0, facetedMethodParameter));
 
-        final Facet facet = facetHolder.getFacet(NamedFacet.class);
+        final Facet facet = facetedMethodParameter.getFacet(NamedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NamedFacetAbstract);
         final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/aggregated/AggregatedAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/aggregated/AggregatedAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/aggregated/AggregatedAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/aggregated/AggregatedAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +24,14 @@ import java.util.List;
 
 import org.apache.isis.applib.annotation.Aggregated;
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.aggregated.AggregatedFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.aggregated.annotation.AggregatedAnnotationFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.aggregated.annotation.AggregatedFacetAnnotation;
 
 
 public class AggregatedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -60,9 +65,9 @@ public class AggregatedAnnotationFacetFa
         @Aggregated
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(AggregatedFacet.class);
+        final Facet facet = facetedMethod.getFacet(AggregatedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof AggregatedFacetAnnotation);
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +24,13 @@ import java.util.List;
 
 import org.apache.isis.applib.annotation.Bounded;
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.bounded.BoundedFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.bounded.annotation.BoundedAnnotationFacetFactory;
 
 
 public class BoundedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -60,9 +64,9 @@ public class BoundedAnnotationFacetFacto
         @Bounded
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(BoundedFacet.class);
+        final Facet facet = facetedMethod.getFacet(BoundedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof BoundedFacetAbstract);
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedMarkerInterfaceFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedMarkerInterfaceFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedMarkerInterfaceFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/bounded/BoundedMarkerInterfaceFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +24,13 @@ import java.util.List;
 
 import org.apache.isis.applib.marker.Bounded;
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.bounded.BoundedFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.bounded.markerifc.BoundedMarkerInterfaceFacetFactory;
 
 
 public class BoundedMarkerInterfaceFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -59,9 +63,9 @@ public class BoundedMarkerInterfaceFacet
     public void testBoundedInterfaceAnnotationPickedUpOnClass() {
         class Customer implements Bounded {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(BoundedFacet.class);
+        final Facet facet = facetedMethod.getFacet(BoundedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof BoundedFacetAbstract);
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,11 +24,14 @@ import java.lang.reflect.Method;
 import java.util.List;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedCallbackFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.callbacks.CreatedCallbackFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.callbacks.CreatedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.callbacks.create.CreatedCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.create.CreatedCallbackFacetViaMethod;
 
 
 public class CreatedCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -66,9 +69,9 @@ public class CreatedCallbackFacetFactory
         }
         final Method method = findMethod(Customer.class, "created");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(CreatedCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(CreatedCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof CreatedCallbackFacetViaMethod);
         final CreatedCallbackFacetViaMethod createdCallbackFacetViaMethod = (CreatedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,24 +24,27 @@ import java.lang.reflect.Method;
 import java.util.List;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.callbacks.DeleteCallbackFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.callbacks.RemovedCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.RemovingCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.callbacks.remove.RemoveCallbackViaDeleteMethodFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.remove.RemovedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.remove.RemovingCallbackFacetViaMethod;
 
 
 public class DeleteCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 
-    private DeleteCallbackFacetFactory facetFactory;
+    private RemoveCallbackViaDeleteMethodFacetFactory facetFactory;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
 
-        facetFactory = new DeleteCallbackFacetFactory();
+        facetFactory = new RemoveCallbackViaDeleteMethodFacetFactory();
     }
 
     @Override
@@ -69,9 +72,9 @@ public class DeleteCallbackFacetFactoryT
         }
         final Method method = findMethod(Customer.class, "deleting");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(RemovingCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(RemovingCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof RemovingCallbackFacetViaMethod);
         final RemovingCallbackFacetViaMethod deletingCallbackFacetViaMethod = (RemovingCallbackFacetViaMethod) facet;
@@ -88,9 +91,9 @@ public class DeleteCallbackFacetFactoryT
         }
         final Method method = findMethod(Customer.class, "deleted");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(RemovedCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(RemovedCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof RemovedCallbackFacetViaMethod);
         final RemovedCallbackFacetViaMethod deletedCallbackFacetViaMethod = (RemovedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/LoadCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/LoadCallbackFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/LoadCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/LoadCallbackFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,13 +24,16 @@ import java.lang.reflect.Method;
 import java.util.List;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.LoadingCallbackFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.callbacks.LoadCallbackFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.callbacks.LoadedCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.LoadingCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.callbacks.load.LoadCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.load.LoadedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.load.LoadingCallbackFacetViaMethod;
 
 
 public class LoadCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -69,9 +72,9 @@ public class LoadCallbackFacetFactoryTes
         }
         final Method method = findMethod(Customer.class, "loading");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(LoadingCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(LoadingCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof LoadingCallbackFacetViaMethod);
         final LoadingCallbackFacetViaMethod loadingCallbackFacetViaMethod = (LoadingCallbackFacetViaMethod) facet;
@@ -88,9 +91,9 @@ public class LoadCallbackFacetFactoryTes
         }
         final Method method = findMethod(Customer.class, "loaded");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(LoadedCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(LoadedCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof LoadedCallbackFacetViaMethod);
         final LoadedCallbackFacetViaMethod loadedCallbackFacetViaMethod = (LoadedCallbackFacetViaMethod) facet;



Mime
View raw message