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 [5/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/object/callback/PersistAndSaveCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/PersistAndSaveCallbackFacetFactoryTest.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/PersistAndSaveCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/PersistAndSaveCallbackFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,25 +24,28 @@ 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.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistCallbackFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistedCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistingCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.SaveCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistingCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistCallbackViaSaveMethodFacetFactory;
 
 
 public class PersistAndSaveCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 
-    private SaveCallbackFacetFactory saveFacetFactory;
+    private PersistCallbackViaSaveMethodFacetFactory saveFacetFactory;
     private PersistCallbackFacetFactory persistFacetFactory;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
 
-        saveFacetFactory = new SaveCallbackFacetFactory();
+        saveFacetFactory = new PersistCallbackViaSaveMethodFacetFactory();
         persistFacetFactory = new PersistCallbackFacetFactory();
     }
 
@@ -70,10 +73,10 @@ public class PersistAndSaveCallbackFacet
         final Method saveMethod = findMethod(Customer.class, "saving");
         final Method persistMethod = findMethod(Customer.class, "persisting");
 
-        saveFacetFactory.process(Customer.class, methodRemover, facetHolder);
-        persistFacetFactory.process(Customer.class, methodRemover, facetHolder);
+        saveFacetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
+        persistFacetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(PersistingCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PersistingCallbackFacetViaMethod);
         final PersistingCallbackFacetViaMethod persistingCallbackFacetViaMethod = (PersistingCallbackFacetViaMethod) facet;
@@ -95,10 +98,10 @@ public class PersistAndSaveCallbackFacet
         final Method saveMethod = findMethod(Customer.class, "saved");
         final Method persistMethod = findMethod(Customer.class, "persisted");
 
-        saveFacetFactory.process(Customer.class, methodRemover, facetHolder);
-        persistFacetFactory.process(Customer.class, methodRemover, facetHolder);
+        saveFacetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
+        persistFacetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(PersistedCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PersistedCallbackFacetViaMethod);
         final PersistedCallbackFacetViaMethod persistedCallbackFacetViaMethod = (PersistedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/PersistCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/PersistCallbackFacetFactoryTest.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/PersistCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/PersistCallbackFacetFactoryTest.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.PersistedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistCallbackFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistedCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistingCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistingCallbackFacetViaMethod;
 
 
 public class PersistCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -69,9 +72,9 @@ public class PersistCallbackFacetFactory
         }
         final Method method = findMethod(Customer.class, "persisting");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(PersistingCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PersistingCallbackFacetViaMethod);
         final PersistingCallbackFacetViaMethod persistingCallbackFacetViaMethod = (PersistingCallbackFacetViaMethod) facet;
@@ -88,9 +91,9 @@ public class PersistCallbackFacetFactory
         }
         final Method method = findMethod(Customer.class, "persisted");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(PersistedCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PersistedCallbackFacetViaMethod);
         final PersistedCallbackFacetViaMethod persistedCallbackFacetViaMethod = (PersistedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.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/RemoveAndDeleteCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,26 +24,29 @@ 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.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.RemoveCallbackFacetFactory;
-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.RemoveCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.remove.RemovedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.remove.RemovingCallbackFacetViaMethod;
 
 
 public class RemoveAndDeleteCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 
 	private RemoveCallbackFacetFactory removeFacetFactory;
-    private DeleteCallbackFacetFactory deleteFacetFactory;
+    private RemoveCallbackViaDeleteMethodFacetFactory deleteFacetFactory;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
 
         removeFacetFactory = new RemoveCallbackFacetFactory();
-        deleteFacetFactory = new DeleteCallbackFacetFactory();
+        deleteFacetFactory = new RemoveCallbackViaDeleteMethodFacetFactory();
     }
 
 	@Override
@@ -70,10 +73,10 @@ public class RemoveAndDeleteCallbackFace
         final Method deleteMethod = findMethod(Customer.class, "deleting");
         final Method removeMethod = findMethod(Customer.class, "removing");
 
-        removeFacetFactory.process(Customer.class, methodRemover, facetHolder);
-        deleteFacetFactory.process(Customer.class, methodRemover, facetHolder);
+        removeFacetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
+        deleteFacetFactory.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 removingCallbackFacetViaMethod = (RemovingCallbackFacetViaMethod) facet;
@@ -95,10 +98,10 @@ public class RemoveAndDeleteCallbackFace
         final Method removeMethod = findMethod(Customer.class, "removed");
         final Method deleteMethod = findMethod(Customer.class, "deleted");
 
-        removeFacetFactory.process(Customer.class, methodRemover, facetHolder);
-        deleteFacetFactory.process(Customer.class, methodRemover, facetHolder);
+        removeFacetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
+        deleteFacetFactory.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 removedCallbackFacetViaMethod = (RemovedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/RemoveCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/RemoveCallbackFacetFactoryTest.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/RemoveCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/RemoveCallbackFacetFactoryTest.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.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.RemoveCallbackFacetFactory;
-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.RemoveCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.remove.RemovedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.remove.RemovingCallbackFacetViaMethod;
 
 
 public class RemoveCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -69,9 +72,9 @@ public class RemoveCallbackFacetFactoryT
         }
         final Method method = findMethod(Customer.class, "removing");
 
-        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 removingCallbackFacetViaMethod = (RemovingCallbackFacetViaMethod) facet;
@@ -88,9 +91,9 @@ public class RemoveCallbackFacetFactoryT
         }
         final Method method = findMethod(Customer.class, "removed");
 
-        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 removedCallbackFacetViaMethod = (RemovedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/SaveCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/SaveCallbackFacetFactoryTest.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/SaveCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/SaveCallbackFacetFactoryTest.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.PersistedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistedCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.PersistingCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.SaveCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistingCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.persist.PersistCallbackViaSaveMethodFacetFactory;
 
 
 public class SaveCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 
-    private SaveCallbackFacetFactory facetFactory;
+    private PersistCallbackViaSaveMethodFacetFactory facetFactory;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
 
-        facetFactory = new SaveCallbackFacetFactory();
+        facetFactory = new PersistCallbackViaSaveMethodFacetFactory();
     }
 
     @Override
@@ -69,9 +72,9 @@ public class SaveCallbackFacetFactoryTes
         }
         final Method method = findMethod(Customer.class, "saving");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(PersistingCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PersistingCallbackFacetViaMethod);
         final PersistingCallbackFacetViaMethod savingCallbackFacetViaMethod = (PersistingCallbackFacetViaMethod) facet;
@@ -88,9 +91,9 @@ public class SaveCallbackFacetFactoryTes
         }
         final Method method = findMethod(Customer.class, "saved");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(PersistedCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PersistedCallbackFacetViaMethod);
         final PersistedCallbackFacetViaMethod savedCallbackFacetViaMethod = (PersistedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/UpdateCallbackFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/UpdateCallbackFacetFactoryTest.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/UpdateCallbackFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/callback/UpdateCallbackFacetFactoryTest.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.UpdatedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingCallbackFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.callbacks.UpdateCallbackFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.callbacks.UpdatedCallbackFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.object.callbacks.UpdatingCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.callbacks.update.UpdateCallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.callbacks.update.UpdatedCallbackFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.callbacks.update.UpdatingCallbackFacetViaMethod;
 
 
 public class UpdateCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -69,9 +72,9 @@ public class UpdateCallbackFacetFactoryT
         }
         final Method method = findMethod(Customer.class, "updating");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(UpdatingCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(UpdatingCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof UpdatingCallbackFacetViaMethod);
         final UpdatingCallbackFacetViaMethod updatingCallbackFacetViaMethod = (UpdatingCallbackFacetViaMethod) facet;
@@ -88,9 +91,9 @@ public class UpdateCallbackFacetFactoryT
         }
         final Method method = findMethod(Customer.class, "updated");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(UpdatedCallbackFacet.class);
+        final Facet facet = facetedMethod.getFacet(UpdatedCallbackFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof UpdatedCallbackFacetViaMethod);
         final UpdatedCallbackFacetViaMethod updatedCallbackFacetViaMethod = (UpdatedCallbackFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/defaults/DefaultedFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/defaults/DefaultedFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/defaults/DefaultedFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/defaults/DefaultedFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,8 +24,15 @@ import java.util.List;
 import org.apache.isis.applib.adapters.DefaultsProvider;
 import org.apache.isis.applib.annotation.Defaulted;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+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.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.defaults.DefaultedAnnotationFacetFactory;
+import org.apache.isis.core.progmodel.facets.defaults.DefaultedFacet;
+import org.apache.isis.core.progmodel.facets.defaults.DefaultedFacetAbstract;
+import org.apache.isis.core.progmodel.facets.defaults.DefaultsProviderUtil;
 
 public class DefaultedFacetFactoryTest extends AbstractFacetFactoryTest {
 
@@ -58,24 +65,24 @@ public class DefaultedFacetFactoryTest e
     }
 
     public void testFacetPickedUp() {
-        facetFactory.process(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetedMethod));
 
-        final DefaultedFacet facet = facetHolder.getFacet(DefaultedFacet.class);
+        final DefaultedFacet facet = facetedMethod.getFacet(DefaultedFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof DefaultedFacetAbstract);
     }
 
     public void testFacetFacetHolderStored() {
 
-        facetFactory.process(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetedMethod));
 
-        final DefaultedFacetAbstract valueFacet = (DefaultedFacetAbstract) facetHolder.getFacet(DefaultedFacet.class);
-        assertEquals(facetHolder, valueFacet.getFacetHolder());
+        final DefaultedFacetAbstract valueFacet = (DefaultedFacetAbstract) facetedMethod.getFacet(DefaultedFacet.class);
+        assertEquals(facetedMethod, valueFacet.getFacetHolder());
     }
 
     public void testNoMethodsRemoved() {
 
-        facetFactory.process(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetedMethod));
 
         assertNoMethodsRemoved();
     }
@@ -103,8 +110,8 @@ public class DefaultedFacetFactoryTest e
     }
 
     public void testDefaultedUsingDefaultsProviderName() {
-        facetFactory.process(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetHolder);
-        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetHolder.getFacet(DefaultedFacet.class);
+        facetFactory.process(new ProcessClassContext(MyDefaultedUsingDefaultsProvider.class, methodRemover, facetedMethod));
+        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetedMethod.getFacet(DefaultedFacet.class);
         assertEquals(MyDefaultedUsingDefaultsProvider.class, facet.getDefaultsProviderClass());
     }
 
@@ -125,8 +132,8 @@ public class DefaultedFacetFactoryTest e
     }
 
     public void testDefaultedUsingDefaultsProviderClass() {
-        facetFactory.process(MyDefaultedUsingDefaultsProviderClass.class, methodRemover, facetHolder);
-        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetHolder.getFacet(DefaultedFacet.class);
+        facetFactory.process(new ProcessClassContext(MyDefaultedUsingDefaultsProviderClass.class, methodRemover, facetedMethod));
+        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetedMethod.getFacet(DefaultedFacet.class);
         assertEquals(MyDefaultedUsingDefaultsProviderClass.class, facet.getDefaultsProviderClass());
     }
 
@@ -152,8 +159,8 @@ public class DefaultedFacetFactoryTest e
     }
 
     public void testDefaultedMustHaveANoArgConstructor() {
-        facetFactory.process(MyDefaultedWithoutNoArgConstructor.class, methodRemover, facetHolder);
-        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetHolder.getFacet(DefaultedFacet.class);
+        facetFactory.process(new ProcessClassContext(MyDefaultedWithoutNoArgConstructor.class, methodRemover, facetedMethod));
+        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetedMethod.getFacet(DefaultedFacet.class);
         assertNull(facet);
     }
 
@@ -176,8 +183,8 @@ public class DefaultedFacetFactoryTest e
     }
 
     public void testDefaultedHaveAPublicNoArgConstructor() {
-        facetFactory.process(MyDefaultedWithoutPublicNoArgConstructor.class, methodRemover, facetHolder);
-        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetHolder.getFacet(DefaultedFacet.class);
+        facetFactory.process(new ProcessClassContext(MyDefaultedWithoutPublicNoArgConstructor.class, methodRemover, facetedMethod));
+        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetedMethod.getFacet(DefaultedFacet.class);
         assertNull(facet);
     }
 
@@ -202,9 +209,8 @@ public class DefaultedFacetFactoryTest e
             "org.apache.isis.core.progmodel.facets.object.defaults.DefaultedFacetFactoryTest$MyDefaultedWithDefaultsProviderSpecifiedUsingConfiguration";
         isisConfigurationDefault.add(DefaultsProviderUtil.DEFAULTS_PROVIDER_NAME_KEY_PREFIX + canonical(className)
             + DefaultsProviderUtil.DEFAULTS_PROVIDER_NAME_KEY_SUFFIX, className);
-        facetFactory.process(MyDefaultedWithDefaultsProviderSpecifiedUsingConfiguration.class, methodRemover,
-            facetHolder);
-        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetHolder.getFacet(DefaultedFacet.class);
+        facetFactory.process(new ProcessClassContext(MyDefaultedWithDefaultsProviderSpecifiedUsingConfiguration.class, methodRemover, facetedMethod));
+        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetedMethod.getFacet(DefaultedFacet.class);
         assertNotNull(facet);
         assertEquals(MyDefaultedWithDefaultsProviderSpecifiedUsingConfiguration.class, facet.getDefaultsProviderClass());
     }
@@ -229,9 +235,8 @@ public class DefaultedFacetFactoryTest e
             "org.apache.isis.core.progmodel.facets.object.defaults.DefaultedFacetFactoryTest$NonAnnotatedDefaultedDefaultsProviderSpecifiedUsingConfiguration";
         isisConfigurationDefault.add(DefaultsProviderUtil.DEFAULTS_PROVIDER_NAME_KEY_PREFIX + canonical(className)
             + DefaultsProviderUtil.DEFAULTS_PROVIDER_NAME_KEY_SUFFIX, className);
-        facetFactory.process(NonAnnotatedDefaultedDefaultsProviderSpecifiedUsingConfiguration.class, methodRemover,
-            facetHolder);
-        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetHolder.getFacet(DefaultedFacet.class);
+        facetFactory.process(new ProcessClassContext(NonAnnotatedDefaultedDefaultsProviderSpecifiedUsingConfiguration.class, methodRemover, facetedMethod));
+        final DefaultedFacetAbstract facet = (DefaultedFacetAbstract) facetedMethod.getFacet(DefaultedFacet.class);
         assertNotNull(facet);
         assertEquals(NonAnnotatedDefaultedDefaultsProviderSpecifiedUsingConfiguration.class,
             facet.getDefaultsProviderClass());

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,11 +24,18 @@ 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.dirty.ClearDirtyObjectFacet;
 import org.apache.isis.core.metamodel.facets.object.dirty.IsDirtyObjectFacet;
 import org.apache.isis.core.metamodel.facets.object.dirty.MarkDirtyObjectFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.dirty.method.ClearDirtyObjectFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.dirty.method.DirtyMethodsFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.dirty.method.IsDirtyObjectFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.dirty.method.MarkDirtyObjectFacetViaMethod;
 
 
 public class DirtyMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -66,9 +73,9 @@ public class DirtyMethodsFacetFactoryTes
         }
         final Method method = findMethod(Customer.class, "markDirty");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(MarkDirtyObjectFacet.class);
+        final Facet facet = facetedMethod.getFacet(MarkDirtyObjectFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof MarkDirtyObjectFacetViaMethod);
         final MarkDirtyObjectFacetViaMethod markDirtyFacet = (MarkDirtyObjectFacetViaMethod) facet;
@@ -87,9 +94,9 @@ public class DirtyMethodsFacetFactoryTes
         }
         final Method method = findMethod(Customer.class, "isDirty");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(IsDirtyObjectFacet.class);
+        final Facet facet = facetedMethod.getFacet(IsDirtyObjectFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof IsDirtyObjectFacetViaMethod);
         final IsDirtyObjectFacetViaMethod isDirtyFacet = (IsDirtyObjectFacetViaMethod) facet;
@@ -106,9 +113,9 @@ public class DirtyMethodsFacetFactoryTes
         }
         final Method method = findMethod(Customer.class, "clearDirty");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ClearDirtyObjectFacet.class);
+        final Facet facet = facetedMethod.getFacet(ClearDirtyObjectFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ClearDirtyObjectFacetViaMethod);
         final ClearDirtyObjectFacetViaMethod clearDirtyFacet = (ClearDirtyObjectFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/encodable/EncodableFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/encodable/EncodableFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/encodable/EncodableFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/encodable/EncodableFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,12 +24,15 @@ import java.util.List;
 import org.apache.isis.applib.adapters.EncoderDecoder;
 import org.apache.isis.applib.annotation.Encodable;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+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.encodeable.EncodableFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.progmodel.facets.object.encodeable.EncodableAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.encodeable.EncodableFacetAbstract;
-import org.apache.isis.core.progmodel.facets.object.encodeable.EncoderDecoderUtil;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.encodeable.EncodableAnnotationFacetFactory;
+import org.apache.isis.core.progmodel.facets.encodeable.EncodableFacetAbstract;
+import org.apache.isis.core.progmodel.facets.encodeable.EncoderDecoderUtil;
 
 public class EncodableFacetFactoryTest extends AbstractFacetFactoryTest {
 
@@ -63,24 +66,24 @@ public class EncodableFacetFactoryTest e
 
     public void testFacetPickedUp() {
 
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetedMethod));
 
-        final EncodableFacet facet = facetHolder.getFacet(EncodableFacet.class);
+        final EncodableFacet facet = facetedMethod.getFacet(EncodableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof EncodableFacetAbstract);
     }
 
     public void testFacetFacetHolderStored() {
 
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetedMethod));
 
-        final EncodableFacetAbstract valueFacet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
-        assertEquals(facetHolder, valueFacet.getFacetHolder());
+        final EncodableFacetAbstract valueFacet = (EncodableFacetAbstract) facetedMethod.getFacet(EncodableFacet.class);
+        assertEquals(facetedMethod, valueFacet.getFacetHolder());
     }
 
     public void testNoMethodsRemoved() {
 
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetedMethod));
 
         assertNoMethodsRemoved();
     }
@@ -112,10 +115,10 @@ public class EncodableFacetFactoryTest e
 
     public void testEncodeableUsingEncoderDecoderName() {
 
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetedMethod));
 
         final EncodableFacetAbstract encodeableFacet =
-            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+            (EncodableFacetAbstract) facetedMethod.getFacet(EncodableFacet.class);
         assertEquals(MyEncodableUsingEncoderDecoderName.class, encodeableFacet.getEncoderDecoderClass());
     }
 
@@ -133,10 +136,10 @@ public class EncodableFacetFactoryTest e
 
     public void testEncodeableUsingEncoderDecoderClass() {
 
-        facetFactory.process(MyEncodeableUsingEncoderDecoderClass.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyEncodeableUsingEncoderDecoderClass.class, methodRemover, facetedMethod));
 
         final EncodableFacetAbstract encodeableFacet =
-            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+            (EncodableFacetAbstract) facetedMethod.getFacet(EncodableFacet.class);
         assertEquals(MyEncodeableUsingEncoderDecoderClass.class, encodeableFacet.getEncoderDecoderClass());
     }
 
@@ -157,10 +160,10 @@ public class EncodableFacetFactoryTest e
     }
 
     public void testEncodeableHaveANoArgConstructor() {
-        facetFactory.process(MyEncodeableWithoutNoArgConstructor.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyEncodeableWithoutNoArgConstructor.class, methodRemover, facetedMethod));
 
         final EncodableFacetAbstract encodeableFacet =
-            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+            (EncodableFacetAbstract) facetedMethod.getFacet(EncodableFacet.class);
         assertNull(encodeableFacet);
     }
 
@@ -178,10 +181,10 @@ public class EncodableFacetFactoryTest e
     }
 
     public void testEncodeableHaveAPublicNoArgConstructor() {
-        facetFactory.process(MyEncodeableWithoutPublicNoArgConstructor.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyEncodeableWithoutPublicNoArgConstructor.class, methodRemover, facetedMethod));
 
         final EncodableFacetAbstract encodeableFacet =
-            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+            (EncodableFacetAbstract) facetedMethod.getFacet(EncodableFacet.class);
         assertNull(encodeableFacet);
     }
 
@@ -202,8 +205,8 @@ public class EncodableFacetFactoryTest e
         isisConfigurationDefault.add(EncoderDecoderUtil.ENCODER_DECODER_NAME_KEY_PREFIX + canonical(className)
             + EncoderDecoderUtil.ENCODER_DECODER_NAME_KEY_SUFFIX, className);
         facetFactory
-            .process(MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration.class, methodRemover, facetHolder);
-        final EncodableFacetAbstract facet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+            .process(new ProcessClassContext(MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration.class, methodRemover, facetedMethod));
+        final EncodableFacetAbstract facet = (EncodableFacetAbstract) facetedMethod.getFacet(EncodableFacet.class);
         assertNotNull(facet);
         assertEquals(MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration.class, facet.getEncoderDecoderClass());
     }
@@ -223,9 +226,8 @@ public class EncodableFacetFactoryTest e
             "org.apache.isis.core.progmodel.facets.object.encodable.EncodableFacetFactoryTest$NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration";
         isisConfigurationDefault.add(EncoderDecoderUtil.ENCODER_DECODER_NAME_KEY_PREFIX + canonical(className)
             + EncoderDecoderUtil.ENCODER_DECODER_NAME_KEY_SUFFIX, className);
-        facetFactory.process(NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration.class, methodRemover,
-            facetHolder);
-        final EncodableFacetAbstract facet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+        facetFactory.process(new ProcessClassContext(NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration.class, methodRemover, facetedMethod));
+        final EncodableFacetAbstract facet = (EncodableFacetAbstract) facetedMethod.getFacet(EncodableFacet.class);
         assertNotNull(facet);
         assertEquals(NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration.class,
             facet.getEncoderDecoderClass());

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -19,17 +19,17 @@
 
 package org.apache.isis.core.progmodel.facets.object.facets;
 
-import java.lang.reflect.Method;
 import java.util.List;
 
 import org.apache.isis.applib.annotation.Facets;
 import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetFactory;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.facets.FacetFactory;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.facets.FacetsFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.object.facets.annotation.FacetsAnnotationFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.facets.annotation.FacetsFacetAnnotation;
 
 public class FacetsAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
 
@@ -65,19 +65,15 @@ public class FacetsAnnotationFacetFactor
         }
 
         @Override
-        public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-            return false;
+        public void process(ProcessClassContext processClassContaxt) {
         }
 
         @Override
-        public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover,
-            final FacetHolder holder) {
-            return false;
+        public void process(ProcessMethodContext processMethodContext) {
         }
 
         @Override
-        public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
-            return false;
+        public void processParams(ProcessParameterContext processParameterContext) {
         }
     }
 
@@ -88,19 +84,15 @@ public class FacetsAnnotationFacetFactor
         }
 
         @Override
-        public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-            return false;
+        public void process(ProcessClassContext processClassContaxt) {
         }
 
         @Override
-        public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover,
-            final FacetHolder holder) {
-            return false;
+        public void process(ProcessMethodContext processMethodContext) {
         }
 
         @Override
-        public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
-            return false;
+        public void processParams(ProcessParameterContext processParameterContext) {
         }
     }
 
@@ -111,9 +103,9 @@ public class FacetsAnnotationFacetFactor
         class Customer {
         }
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        final Facet facet = facetedMethod.getFacet(FacetsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof FacetsFacetAnnotation);
         final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
@@ -131,9 +123,9 @@ public class FacetsAnnotationFacetFactor
         class Customer {
         }
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        final Facet facet = facetedMethod.getFacet(FacetsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof FacetsFacetAnnotation);
         final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
@@ -150,9 +142,9 @@ public class FacetsAnnotationFacetFactor
         class Customer {
         }
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        final Facet facet = facetedMethod.getFacet(FacetsFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof FacetsFacetAnnotation);
         final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
@@ -167,9 +159,9 @@ public class FacetsAnnotationFacetFactor
         class Customer {
         }
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        final Facet facet = facetedMethod.getFacet(FacetsFacet.class);
         assertNull(facet);
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetViaMethodTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetViaMethodTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetViaMethodTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetViaMethodTest.java Mon Jan 17 09:26:54 2011
@@ -37,6 +37,7 @@ import org.junit.runner.RunWith;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.object.icon.method.IconFacetViaMethod;
 
 @RunWith(JMock.class)
 public class IconFacetViaMethodTest  {

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +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.ident.icon.IconFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.icon.method.IconFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.icon.method.IconMethodFacetFactory;
 
 
 public class IconMethodFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -66,9 +71,9 @@ public class IconMethodFacetFactoryTest 
         }
         final Method iconNameMethod = findMethod(Customer.class, "iconName");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(IconFacet.class);
+        final Facet facet = facetedMethod.getFacet(IconFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof IconFacetViaMethod);
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +24,14 @@ import java.util.List;
 
 import org.apache.isis.applib.annotation.Plural;
 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.ident.plural.PluralFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.plural.annotation.PluralAnnotationFacetFactory;
+import org.apache.isis.core.progmodel.facets.object.plural.annotation.PluralFacetAnnotation;
 
 
 public class PluralAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -60,9 +65,9 @@ public class PluralAnnotationFacetFactor
         @Plural("Some plural name")
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PluralFacet.class);
+        final Facet facet = facetedMethod.getFacet(PluralFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PluralFacetAnnotation);
         final PluralFacetAnnotation pluralFacet = (PluralFacetAnnotation) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +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.ident.plural.PluralFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
+import org.apache.isis.core.progmodel.facets.object.plural.staticmethod.PluralFacetViaMethod;
+import org.apache.isis.core.progmodel.facets.object.plural.staticmethod.PluralMethodFacetFactory;
 
 
 public class PluralMethodFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -65,9 +70,9 @@ public class PluralMethodFacetFactoryTes
     public void testPluralNameMethodPickedUpOnClassAndMethodRemoved() {
         final Method pluralNameMethod = findMethod(Customer.class, "pluralName");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(PluralFacet.class);
+        final Facet facet = facetedMethod.getFacet(PluralFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof PluralFacetViaMethod);
         final PluralFacetViaMethod pluralFacet = (PluralFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +24,12 @@ 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.naming.named.NamedFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
 
 
 public class SingularMethodFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -65,9 +68,9 @@ public class SingularMethodFacetFactoryT
     public void testSingularNameMethodPickedUpOnClassAndMethodRemoved() {
         final Method singularNameMethod = findMethod(Customer.class, "singularName");
 
-        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 NamedFacetViaMethod);
         final NamedFacetViaMethod namedFacetViaMethod = (NamedFacetViaMethod) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,10 +24,13 @@ 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.ident.title.TitleFacet;
 import org.apache.isis.core.metamodel.specloader.specimpl.ObjectSpecificationAbstract;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
 
 
 public class TitleMethodFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -67,9 +70,9 @@ public class TitleMethodFacetFactoryTest
         }
         final Method titleMethod = findMethod(Customer.class, "title");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(TitleFacet.class);
+        final Facet facet = facetedMethod.getFacet(TitleFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof TitleFacetViaTitleMethod);
         final TitleFacetViaTitleMethod titleFacetViaTitleMethod = (TitleFacetViaTitleMethod) facet;
@@ -87,9 +90,9 @@ public class TitleMethodFacetFactoryTest
         }
         final Method toStringMethod = findMethod(Customer.class, "toString");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(TitleFacet.class);
+        final Facet facet = facetedMethod.getFacet(TitleFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof TitleFacetViaToStringMethod);
         final TitleFacetViaToStringMethod titleFacetViaTitleMethod = (TitleFacetViaToStringMethod) facet;
@@ -103,15 +106,15 @@ public class TitleMethodFacetFactoryTest
      * is the superclass has a none no-op implementation.
      */
     public void testTitleFacetMethodUsingToStringIsClassifiedAsANoop() {
-        assertTrue(new TitleFacetViaToStringMethod(null, facetHolder).isNoop());
+        assertTrue(new TitleFacetViaToStringMethod(null, facetedMethod).isNoop());
     }
 
     public void testNoExplicitTitleOrToStringMethod() {
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        assertNull(facetHolder.getFacet(TitleFacet.class));
+        assertNull(facetedMethod.getFacet(TitleFacet.class));
 
         assertNoMethodsRemoved();
     }

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -25,9 +25,12 @@ import java.util.List;
 import org.apache.isis.applib.annotation.Immutable;
 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.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
 
 
 public class ImmutableAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -61,9 +64,9 @@ public class ImmutableAnnotationFacetFac
         @Immutable
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetAnnotation);
         final ImmutableFacetAnnotation immutableFacetAnnotation = (ImmutableFacetAnnotation) facet;
@@ -76,9 +79,9 @@ public class ImmutableAnnotationFacetFac
         @Immutable(When.ALWAYS)
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetAnnotation);
         final ImmutableFacetAnnotation immutableFacetAnnotation = (ImmutableFacetAnnotation) facet;
@@ -91,9 +94,9 @@ public class ImmutableAnnotationFacetFac
         @Immutable(When.NEVER)
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetAnnotation);
         final ImmutableFacetAnnotation immutableFacetAnnotation = (ImmutableFacetAnnotation) facet;
@@ -106,9 +109,9 @@ public class ImmutableAnnotationFacetFac
         @Immutable(When.ONCE_PERSISTED)
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetAnnotation);
         final ImmutableFacetAnnotation immutableFacetAnnotation = (ImmutableFacetAnnotation) facet;
@@ -121,9 +124,9 @@ public class ImmutableAnnotationFacetFac
         @Immutable(When.UNTIL_PERSISTED)
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetAnnotation);
         final ImmutableFacetAnnotation immutableFacetAnnotation = (ImmutableFacetAnnotation) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfaceFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfaceFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfaceFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfaceFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -27,9 +27,12 @@ import org.apache.isis.applib.marker.Imm
 import org.apache.isis.applib.marker.ImmutableUntilPersisted;
 import org.apache.isis.applib.marker.NeverImmutable;
 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.immutable.ImmutableFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
 
 
 public class ImmutableMarkerInterfaceFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -62,9 +65,9 @@ public class ImmutableMarkerInterfaceFac
     public void testAlwaysImmutable() {
         class Customer implements AlwaysImmutable {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetMarkerInterface);
         final ImmutableFacetMarkerInterface immutableFacetMarkerInterface = (ImmutableFacetMarkerInterface) facet;
@@ -76,9 +79,9 @@ public class ImmutableMarkerInterfaceFac
     public void testImmutableOncePersisted() {
         class Customer implements ImmutableOncePersisted {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetMarkerInterface);
         final ImmutableFacetMarkerInterface immutableFacetMarkerInterface = (ImmutableFacetMarkerInterface) facet;
@@ -90,9 +93,9 @@ public class ImmutableMarkerInterfaceFac
     public void testImmutableUntilPersisted() {
         class Customer implements ImmutableUntilPersisted {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetMarkerInterface);
         final ImmutableFacetMarkerInterface immutableFacetMarkerInterface = (ImmutableFacetMarkerInterface) facet;
@@ -104,9 +107,9 @@ public class ImmutableMarkerInterfaceFac
     public void testNeverImmutable() {
         class Customer implements NeverImmutable {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(ImmutableFacet.class);
+        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ImmutableFacetMarkerInterface);
         final ImmutableFacetMarkerInterface immutableFacetMarkerInterface = (ImmutableFacetMarkerInterface) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -25,9 +25,12 @@ import java.util.List;
 import org.apache.isis.applib.annotation.NotPersistable;
 import org.apache.isis.applib.annotation.NotPersistable.By;
 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.notpersistable.NotPersistableFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
 
 
 public class NotPersistableAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -61,9 +64,9 @@ public class NotPersistableAnnotationFac
         @NotPersistable
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NotPersistableFacet.class);
+        final Facet facet = facetedMethod.getFacet(NotPersistableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NotPersistableFacetAnnotation);
         final NotPersistableFacetAnnotation notPersistableFacetAnnotation = (NotPersistableFacetAnnotation) facet;
@@ -77,9 +80,9 @@ public class NotPersistableAnnotationFac
         @NotPersistable(By.USER_OR_PROGRAM)
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NotPersistableFacet.class);
+        final Facet facet = facetedMethod.getFacet(NotPersistableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NotPersistableFacetAnnotation);
         final NotPersistableFacetAnnotation notPersistableFacetAnnotation = (NotPersistableFacetAnnotation) facet;
@@ -93,9 +96,9 @@ public class NotPersistableAnnotationFac
         @NotPersistable(By.USER)
         class Customer {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NotPersistableFacet.class);
+        final Facet facet = facetedMethod.getFacet(NotPersistableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NotPersistableFacetAnnotation);
         final NotPersistableFacetAnnotation notPersistableFacetAnnotation = (NotPersistableFacetAnnotation) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfaceFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfaceFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfaceFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfaceFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -25,9 +25,12 @@ import java.util.List;
 import org.apache.isis.applib.marker.NonPersistable;
 import org.apache.isis.applib.marker.ProgramPersistable;
 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.notpersistable.NotPersistableFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
 
 
 public class NotPersistableMarkerInterfaceFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -60,9 +63,9 @@ public class NotPersistableMarkerInterfa
     public void testProgramPersistableMeansNotPersistableByUser() {
         class Customer implements ProgramPersistable {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NotPersistableFacet.class);
+        final Facet facet = facetedMethod.getFacet(NotPersistableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NotPersistableFacetMarkerInterface);
         final NotPersistableFacetMarkerInterface notPersistableFacetMarkerInterface = (NotPersistableFacetMarkerInterface) facet;
@@ -75,9 +78,9 @@ public class NotPersistableMarkerInterfa
     public void testNotPersistable() {
         class Customer implements NonPersistable {}
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
 
-        final Facet facet = facetHolder.getFacet(NotPersistableFacet.class);
+        final Facet facet = facetedMethod.getFacet(NotPersistableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NotPersistableFacetMarkerInterface);
         final NotPersistableFacetMarkerInterface notPersistableFacetMarkerInterface = (NotPersistableFacetMarkerInterface) facet;

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -24,9 +24,12 @@ import java.util.List;
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.applib.annotation.Parseable;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+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.parseable.ParseableFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.ProgrammableMethodRemover;
 
 public class ParseableFacetFactoryTest extends AbstractFacetFactoryTest {
 
@@ -60,25 +63,25 @@ public class ParseableFacetFactoryTest e
 
     public void testFacetPickedUp() {
 
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyParseableUsingParserName.class, methodRemover, facetedMethod));
 
-        final ParseableFacet facet = facetHolder.getFacet(ParseableFacet.class);
+        final ParseableFacet facet = facetedMethod.getFacet(ParseableFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof ParseableFacetAbstract);
     }
 
     public void testFacetFacetHolderStored() {
 
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyParseableUsingParserName.class, methodRemover, facetedMethod));
 
         final ParseableFacetAbstract parseableFacet =
-            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
-        assertEquals(facetHolder, parseableFacet.getFacetHolder());
+            (ParseableFacetAbstract) facetedMethod.getFacet(ParseableFacet.class);
+        assertEquals(facetedMethod, parseableFacet.getFacetHolder());
     }
 
     public void testNoMethodsRemoved() {
 
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyParseableUsingParserName.class, methodRemover, facetedMethod));
 
         assertNoMethodsRemoved();
     }
@@ -95,10 +98,10 @@ public class ParseableFacetFactoryTest e
 
     public void testParseableUsingParserName() {
 
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyParseableUsingParserName.class, methodRemover, facetedMethod));
 
         final ParseableFacetAbstract parseableFacet =
-            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+            (ParseableFacetAbstract) facetedMethod.getFacet(ParseableFacet.class);
         assertEquals(MyParseableUsingParserName.class, parseableFacet.getParserClass());
     }
 
@@ -140,10 +143,10 @@ public class ParseableFacetFactoryTest e
 
     public void testParseableUsingParserClass() {
 
-        facetFactory.process(MyParseableUsingParserClass.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyParseableUsingParserClass.class, methodRemover, facetedMethod));
 
         final ParseableFacetAbstract parseableFacet =
-            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+            (ParseableFacetAbstract) facetedMethod.getFacet(ParseableFacet.class);
         assertEquals(MyParseableUsingParserClass.class, parseableFacet.getParserClass());
     }
 
@@ -162,10 +165,10 @@ public class ParseableFacetFactoryTest e
     }
 
     public void testParseableHaveANoArgConstructor() {
-        facetFactory.process(MyParseableWithoutNoArgConstructor.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyParseableWithoutNoArgConstructor.class, methodRemover, facetedMethod));
 
         final ParseableFacetAbstract parseableFacet =
-            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+            (ParseableFacetAbstract) facetedMethod.getFacet(ParseableFacet.class);
         assertNull(parseableFacet);
     }
 
@@ -183,10 +186,10 @@ public class ParseableFacetFactoryTest e
     }
 
     public void testParseableHaveAPublicNoArgConstructor() {
-        facetFactory.process(MyParseableWithoutPublicNoArgConstructor.class, methodRemover, facetHolder);
+        facetFactory.process(new ProcessClassContext(MyParseableWithoutPublicNoArgConstructor.class, methodRemover, facetedMethod));
 
         final ParseableFacetAbstract parseableFacet =
-            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+            (ParseableFacetAbstract) facetedMethod.getFacet(ParseableFacet.class);
         assertNull(parseableFacet);
     }
 
@@ -206,8 +209,8 @@ public class ParseableFacetFactoryTest e
             "org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetFactoryTest$MyParseableWithParserSpecifiedUsingConfiguration";
         isisConfigurationDefault.add(ParserUtil.PARSER_NAME_KEY_PREFIX + canonical(className)
             + ParserUtil.PARSER_NAME_KEY_SUFFIX, className);
-        facetFactory.process(MyParseableWithParserSpecifiedUsingConfiguration.class, methodRemover, facetHolder);
-        final ParseableFacetAbstract facet = (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+        facetFactory.process(new ProcessClassContext(MyParseableWithParserSpecifiedUsingConfiguration.class, methodRemover, facetedMethod));
+        final ParseableFacetAbstract facet = (ParseableFacetAbstract) facetedMethod.getFacet(ParseableFacet.class);
         assertNotNull(facet);
         assertEquals(MyParseableWithParserSpecifiedUsingConfiguration.class, facet.getParserClass());
     }
@@ -227,8 +230,8 @@ public class ParseableFacetFactoryTest e
             "org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetFactoryTest$NonAnnotatedParseableParserSpecifiedUsingConfiguration";
         isisConfigurationDefault.add(ParserUtil.PARSER_NAME_KEY_PREFIX + canonical(className)
             + ParserUtil.PARSER_NAME_KEY_SUFFIX, className);
-        facetFactory.process(NonAnnotatedParseableParserSpecifiedUsingConfiguration.class, methodRemover, facetHolder);
-        final ParseableFacetAbstract facet = (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+        facetFactory.process(new ProcessClassContext(NonAnnotatedParseableParserSpecifiedUsingConfiguration.class, methodRemover, facetedMethod));
+        final ParseableFacetAbstract facet = (ParseableFacetAbstract) facetedMethod.getFacet(ParseableFacet.class);
         assertNotNull(facet);
         assertEquals(NonAnnotatedParseableParserSpecifiedUsingConfiguration.class, facet.getParserClass());
     }

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/validate/ObjectValidMethodFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/validate/ObjectValidMethodFacetFactoryTest.java?rev=1059826&r1=1059825&r2=1059826&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/validate/ObjectValidMethodFacetFactoryTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/object/validate/ObjectValidMethodFacetFactoryTest.java Mon Jan 17 09:26:54 2011
@@ -25,6 +25,7 @@ import java.util.List;
 
 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.progmodel.facets.AbstractFacetFactoryTest;
 
 
@@ -65,7 +66,8 @@ public class ObjectValidMethodFacetFacto
         }
         final Method validateMethod = findMethod(Customer.class, "validate");
 
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
+        final ProcessClassContext processClassContext = new ProcessClassContext(Customer.class, methodRemover, facetHolder);
+        facetFactory.process(processClassContext);
 
         final Facet facet = facetHolder.getFacet(ValidateObjectFacet.class);
         assertNotNull(facet);



Mime
View raw message