incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1032873 [4/5] - in /incubator/isis/trunk: applib/src/main/java/org/apache/isis/applib/value/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ core/pr...
Date Tue, 09 Nov 2010 07:16:47 GMT
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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -17,202 +17,220 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.object.encodable;
 
-package org.apache.isis.core.progmodel.facets.object.encodable;
-
-import org.apache.isis.applib.adapters.EncoderDecoder;
-import org.apache.isis.applib.annotation.Encodable;
+import org.apache.isis.applib.adapters.EncoderDecoder;
+import org.apache.isis.applib.annotation.Encodable;
 import org.apache.isis.core.metamodel.config.internal.PropertiesConfiguration;
 import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+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.metamodel.facets.AbstractFacetFactoryTest;
-
-
-public class EncodableFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private EncodableAnnotationFacetFactory facetFactory;
-    private PropertiesConfiguration propertiesConfiguration;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new EncodableAnnotationFacetFactory();
-        propertiesConfiguration = new PropertiesConfiguration();
-        facetFactory.setIsisConfiguration(propertiesConfiguration);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-    @Override
-    public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertTrue(contains(featureTypes, ObjectFeatureType.OBJECT));
-        assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
-        assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));
-        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION));
-        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION_PARAMETER));
-    }
-
-    public void testFacetPickedUp() {
-
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
-
-        final EncodableFacet facet = facetHolder.getFacet(EncodableFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof EncodableFacetAbstract);
-    }
-
-    public void testFacetFacetHolderStored() {
-
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
-
-        final EncodableFacetAbstract valueFacet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
-        assertEquals(facetHolder, valueFacet.getFacetHolder());
-    }
-
-    public void testNoMethodsRemoved() {
-
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
-
-        assertNoMethodsRemoved();
-    }
-
-    abstract static class EncoderDecoderNoop<T> implements EncoderDecoder<T> {
-
-        public T fromEncodedString(final String encodedString) {
-            return null;
-        }
-
-        public String toEncodedString(final T toEncode) {
-            return null;
-        }
-    }
-
-    @Encodable(encoderDecoderName = "org.apache.isis.metamodel.facets.object.encodable.EncodableFacetFactoryTest$MyEncodableUsingEncoderDecoderName")
-    public static class MyEncodableUsingEncoderDecoderName extends EncoderDecoderNoop<MyEncodableUsingEncoderDecoderName> {
-
-        /**
-         * Required since is an EncoderDecoder
-         */
-        public MyEncodableUsingEncoderDecoderName() {}
-
-    }
-
-    public void testEncodeableUsingEncoderDecoderName() {
-
-        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
-
-        final EncodableFacetAbstract encodeableFacet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
-        assertEquals(MyEncodableUsingEncoderDecoderName.class, encodeableFacet.getEncoderDecoderClass());
-    }
-
-    @Encodable(encoderDecoderClass = MyEncodeableUsingEncoderDecoderClass.class)
-    public static class MyEncodeableUsingEncoderDecoderClass extends EncoderDecoderNoop<MyEncodeableUsingEncoderDecoderClass> {
-
-        /**
-         * Required since is a EncoderDecoder.
-         */
-        public MyEncodeableUsingEncoderDecoderClass() {}
-
-    }
-
-    public void testEncodeableUsingEncoderDecoderClass() {
-
-        facetFactory.process(MyEncodeableUsingEncoderDecoderClass.class, methodRemover, facetHolder);
-
-        final EncodableFacetAbstract encodeableFacet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
-        assertEquals(MyEncodeableUsingEncoderDecoderClass.class, encodeableFacet.getEncoderDecoderClass());
-    }
-
-    public void testEncodeableMustBeAEncoderDecoder() {
-    // no test, because compiler prevents us from nominating a class that doesn't
-    // implement EncoderDecoder
-    }
-
-    @Encodable(encoderDecoderClass = MyEncodeableWithoutNoArgConstructor.class)
-    public static class MyEncodeableWithoutNoArgConstructor extends EncoderDecoderNoop<MyEncodeableWithoutNoArgConstructor> {
-
-        // no no-arg constructor
-
-        public MyEncodeableWithoutNoArgConstructor(final int value) {}
-
-    }
-
-    public void testEncodeableHaveANoArgConstructor() {
-        facetFactory.process(MyEncodeableWithoutNoArgConstructor.class, methodRemover, facetHolder);
-
-        final EncodableFacetAbstract encodeableFacet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
-        assertNull(encodeableFacet);
-    }
-
-    @Encodable(encoderDecoderClass = MyEncodeableWithoutPublicNoArgConstructor.class)
-    public static class MyEncodeableWithoutPublicNoArgConstructor extends
-            EncoderDecoderNoop<MyEncodeableWithoutPublicNoArgConstructor> {
-
-        // no public no-arg constructor
-        MyEncodeableWithoutPublicNoArgConstructor() {}
-
-        public MyEncodeableWithoutPublicNoArgConstructor(final int value) {}
-
-    }
-
-    public void testEncodeableHaveAPublicNoArgConstructor() {
-        facetFactory.process(MyEncodeableWithoutPublicNoArgConstructor.class, methodRemover, facetHolder);
-
-        final EncodableFacetAbstract encodeableFacet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
-        assertNull(encodeableFacet);
-    }
-
-    @Encodable()
-    public static class MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration extends
-            EncoderDecoderNoop<MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration> {
-
-        /**
-         * Required since is a EncoderDecoder.
-         */
-        public MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration() {}
-    }
-
-    public void testEncoderDecoderNameCanBePickedUpFromConfiguration() {
-        final String className = "org.apache.isis.metamodel.facets.object.encodable.EncodableFacetFactoryTest$MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration";
-        propertiesConfiguration.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);
-        assertNotNull(facet);
-        assertEquals(MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration.class, facet.getEncoderDecoderClass());
-    }
-
-    public static class NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration extends
-            EncoderDecoderNoop<NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration> {
-
-        /**
-         * Required since is a EncoderDecoder.
-         */
-        public NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration() {}
-    }
-
-    public void testNonAnnotatedEncodeableCanPickUpEncoderDecoderFromConfiguration() {
-        final String className = "org.apache.isis.metamodel.facets.object.encodable.EncodableFacetFactoryTest$NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration";
-        propertiesConfiguration.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);
-        assertNotNull(facet);
-        assertEquals(NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration.class, facet.getEncoderDecoderClass());
-    }
-
-    private String canonical(final String className) {
-        return className.replace('$', '.');
-    }
-
-}
-
+
+public class EncodableFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private EncodableAnnotationFacetFactory facetFactory;
+    private PropertiesConfiguration propertiesConfiguration;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new EncodableAnnotationFacetFactory();
+        propertiesConfiguration = new PropertiesConfiguration();
+        facetFactory.setIsisConfiguration(propertiesConfiguration);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    @Override
+    public void testFeatureTypes() {
+        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        assertTrue(contains(featureTypes, ObjectFeatureType.OBJECT));
+        assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
+        assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));
+        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION));
+        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION_PARAMETER));
+    }
+
+    public void testFacetPickedUp() {
+
+        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+
+        final EncodableFacet facet = facetHolder.getFacet(EncodableFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof EncodableFacetAbstract);
+    }
+
+    public void testFacetFacetHolderStored() {
+
+        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+
+        final EncodableFacetAbstract valueFacet = (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+        assertEquals(facetHolder, valueFacet.getFacetHolder());
+    }
+
+    public void testNoMethodsRemoved() {
+
+        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+
+        assertNoMethodsRemoved();
+    }
+
+    abstract static class EncoderDecoderNoop<T> implements EncoderDecoder<T> {
+
+        @Override
+        public T fromEncodedString(final String encodedString) {
+            return null;
+        }
+
+        @Override
+        public String toEncodedString(final T toEncode) {
+            return null;
+        }
+    }
+
+    @Encodable(encoderDecoderName = "org.apache.isis.core.progmodel.facets.object.encodable.EncodableFacetFactoryTest$MyEncodableUsingEncoderDecoderName")
+    public static class MyEncodableUsingEncoderDecoderName extends
+        EncoderDecoderNoop<MyEncodableUsingEncoderDecoderName> {
+
+        /**
+         * Required since is an EncoderDecoder
+         */
+        public MyEncodableUsingEncoderDecoderName() {
+        }
+
+    }
+
+    public void testEncodeableUsingEncoderDecoderName() {
+
+        facetFactory.process(MyEncodableUsingEncoderDecoderName.class, methodRemover, facetHolder);
+
+        final EncodableFacetAbstract encodeableFacet =
+            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+        assertEquals(MyEncodableUsingEncoderDecoderName.class, encodeableFacet.getEncoderDecoderClass());
+    }
+
+    @Encodable(encoderDecoderClass = MyEncodeableUsingEncoderDecoderClass.class)
+    public static class MyEncodeableUsingEncoderDecoderClass extends
+        EncoderDecoderNoop<MyEncodeableUsingEncoderDecoderClass> {
+
+        /**
+         * Required since is a EncoderDecoder.
+         */
+        public MyEncodeableUsingEncoderDecoderClass() {
+        }
+
+    }
+
+    public void testEncodeableUsingEncoderDecoderClass() {
+
+        facetFactory.process(MyEncodeableUsingEncoderDecoderClass.class, methodRemover, facetHolder);
+
+        final EncodableFacetAbstract encodeableFacet =
+            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+        assertEquals(MyEncodeableUsingEncoderDecoderClass.class, encodeableFacet.getEncoderDecoderClass());
+    }
+
+    public void testEncodeableMustBeAEncoderDecoder() {
+        // no test, because compiler prevents us from nominating a class that doesn't
+        // implement EncoderDecoder
+    }
+
+    @Encodable(encoderDecoderClass = MyEncodeableWithoutNoArgConstructor.class)
+    public static class MyEncodeableWithoutNoArgConstructor extends
+        EncoderDecoderNoop<MyEncodeableWithoutNoArgConstructor> {
+
+        // no no-arg constructor
+
+        public MyEncodeableWithoutNoArgConstructor(final int value) {
+        }
+
+    }
+
+    public void testEncodeableHaveANoArgConstructor() {
+        facetFactory.process(MyEncodeableWithoutNoArgConstructor.class, methodRemover, facetHolder);
+
+        final EncodableFacetAbstract encodeableFacet =
+            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+        assertNull(encodeableFacet);
+    }
+
+    @Encodable(encoderDecoderClass = MyEncodeableWithoutPublicNoArgConstructor.class)
+    public static class MyEncodeableWithoutPublicNoArgConstructor extends
+        EncoderDecoderNoop<MyEncodeableWithoutPublicNoArgConstructor> {
+
+        // no public no-arg constructor
+        MyEncodeableWithoutPublicNoArgConstructor() {
+        }
+
+        public MyEncodeableWithoutPublicNoArgConstructor(final int value) {
+        }
+
+    }
+
+    public void testEncodeableHaveAPublicNoArgConstructor() {
+        facetFactory.process(MyEncodeableWithoutPublicNoArgConstructor.class, methodRemover, facetHolder);
+
+        final EncodableFacetAbstract encodeableFacet =
+            (EncodableFacetAbstract) facetHolder.getFacet(EncodableFacet.class);
+        assertNull(encodeableFacet);
+    }
+
+    @Encodable()
+    public static class MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration extends
+        EncoderDecoderNoop<MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration> {
+
+        /**
+         * Required since is a EncoderDecoder.
+         */
+        public MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration() {
+        }
+    }
+
+    public void testEncoderDecoderNameCanBePickedUpFromConfiguration() {
+        final String className =
+            "org.apache.isis.core.progmodel.facets.object.encodable.EncodableFacetFactoryTest$MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration";
+        propertiesConfiguration.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);
+        assertNotNull(facet);
+        assertEquals(MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration.class, facet.getEncoderDecoderClass());
+    }
+
+    public static class NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration extends
+        EncoderDecoderNoop<NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration> {
+
+        /**
+         * Required since is a EncoderDecoder.
+         */
+        public NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration() {
+        }
+    }
+
+    public void testNonAnnotatedEncodeableCanPickUpEncoderDecoderFromConfiguration() {
+        final String className =
+            "org.apache.isis.core.progmodel.facets.object.encodable.EncodableFacetFactoryTest$NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration";
+        propertiesConfiguration.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);
+        assertNotNull(facet);
+        assertEquals(NonAnnotatedEncodeableEncoderDecoderSpecifiedUsingConfiguration.class,
+            facet.getEncoderDecoderClass());
+    }
+
+    private String canonical(final String className) {
+        return className.replace('$', '.');
+    }
+
+}

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -17,149 +17,158 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.object.facets;
 
-package org.apache.isis.core.progmodel.facets.object.facets;
-
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.annotation.Facets;
+import java.lang.reflect.Method;
+
+import org.apache.isis.applib.annotation.Facets;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
-import org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.facets.FacetsFacet;
-import org.apache.isis.core.progmodel.facets.object.facets.FacetsFacetAnnotation;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
-
-
-public class FacetsAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private FacetsAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new FacetsAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-    @Override
-    public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertTrue(contains(featureTypes, ObjectFeatureType.OBJECT));
-        assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
-        assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));
-        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION));
-        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION_PARAMETER));
-    }
-
-    public static class CustomerFacetFactory implements FacetFactory {
-        public ObjectFeatureType[] getFeatureTypes() {
-            return null;
-        }
-
-        public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-            return false;
-        }
-
-        public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-            return false;
-        }
-
-        public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
-            return false;
-        }
-    }
-
-    public static class CustomerFacetFactory2 implements FacetFactory {
-        public ObjectFeatureType[] getFeatureTypes() {
-            return null;
-        }
-
-        public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-            return false;
-        }
-
-        public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-            return false;
-        }
-
-        public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
-            return false;
-        }
-    }
-
-    public void testFacetsFactoryNames() {
-        @Facets(facetFactoryNames = {
-                "org.apache.isis.metamodel.facets.object.facets.FacetsAnnotationFacetFactoryTest$CustomerFacetFactory",
-                "org.apache.isis.metamodel.facets.object.facets.FacetsAnnotationFacetFactoryTest$CustomerNotAFacetFactory" })
-        class Customer {}
-
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
-
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof FacetsFacetAnnotation);
-        final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
-        final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories();
-        assertEquals(1, facetFactories.length);
-        assertEquals(CustomerFacetFactory.class, facetFactories[0]);
-
-        assertNoMethodsRemoved();
-    }
-
-    public void testFacetsFactoryClass() {
-        @Facets(facetFactoryClasses = {
-                org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest.CustomerFacetFactory.class,
-                org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest.CustomerNotAFacetFactory.class })
-        class Customer {}
-
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
-
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof FacetsFacetAnnotation);
-        final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
-        final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories();
-        assertEquals(1, facetFactories.length);
-        assertEquals(CustomerFacetFactory.class, facetFactories[0]);
-    }
-
-    public static class CustomerNotAFacetFactory {}
-
-    public void testFacetsFactoryNameAndClass() {
-        @Facets(facetFactoryNames = { "org.apache.isis.metamodel.facets.object.facets.FacetsAnnotationFacetFactoryTest$CustomerFacetFactory" }, facetFactoryClasses = { org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest.CustomerFacetFactory2.class })
-        class Customer {}
-
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
-
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof FacetsFacetAnnotation);
-        final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
-        final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories();
-        assertEquals(2, facetFactories.length);
-        assertEquals(CustomerFacetFactory.class, facetFactories[0]);
-        assertEquals(CustomerFacetFactory2.class, facetFactories[1]);
-    }
-
-    public void testFacetsFactoryNoop() {
-        @Facets
-        class Customer {}
-
-        facetFactory.process(Customer.class, methodRemover, facetHolder);
-
-        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
-        assertNull(facet);
-    }
-
-}
-
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+
+public class FacetsAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private FacetsAnnotationFacetFactory facetFactory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new FacetsAnnotationFacetFactory();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    @Override
+    public void testFeatureTypes() {
+        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        assertTrue(contains(featureTypes, ObjectFeatureType.OBJECT));
+        assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
+        assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));
+        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION));
+        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION_PARAMETER));
+    }
+
+    public static class CustomerFacetFactory implements FacetFactory {
+        @Override
+        public ObjectFeatureType[] getFeatureTypes() {
+            return null;
+        }
+
+        @Override
+        public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
+            return false;
+        }
+
+        @Override
+        public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover,
+            final FacetHolder holder) {
+            return false;
+        }
+
+        @Override
+        public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
+            return false;
+        }
+    }
+
+    public static class CustomerFacetFactory2 implements FacetFactory {
+        @Override
+        public ObjectFeatureType[] getFeatureTypes() {
+            return null;
+        }
+
+        @Override
+        public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
+            return false;
+        }
+
+        @Override
+        public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover,
+            final FacetHolder holder) {
+            return false;
+        }
+
+        @Override
+        public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
+            return false;
+        }
+    }
+
+    public void testFacetsFactoryNames() {
+        @Facets(facetFactoryNames = {
+            "org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest$CustomerFacetFactory",
+            "org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest$CustomerNotAFacetFactory" })
+        class Customer {
+        }
+
+        facetFactory.process(Customer.class, methodRemover, facetHolder);
+
+        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof FacetsFacetAnnotation);
+        final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
+        final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories();
+        assertEquals(1, facetFactories.length);
+        assertEquals(CustomerFacetFactory.class, facetFactories[0]);
+
+        assertNoMethodsRemoved();
+    }
+
+    public void testFacetsFactoryClass() {
+        @Facets(facetFactoryClasses = {
+            org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest.CustomerFacetFactory.class,
+            org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest.CustomerNotAFacetFactory.class })
+        class Customer {
+        }
+
+        facetFactory.process(Customer.class, methodRemover, facetHolder);
+
+        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof FacetsFacetAnnotation);
+        final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
+        final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories();
+        assertEquals(1, facetFactories.length);
+        assertEquals(CustomerFacetFactory.class, facetFactories[0]);
+    }
+
+    public static class CustomerNotAFacetFactory {
+    }
+
+    public void testFacetsFactoryNameAndClass() {
+        @Facets(facetFactoryNames = { "org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest$CustomerFacetFactory" }, facetFactoryClasses = { org.apache.isis.core.progmodel.facets.object.facets.FacetsAnnotationFacetFactoryTest.CustomerFacetFactory2.class })
+        class Customer {
+        }
+
+        facetFactory.process(Customer.class, methodRemover, facetHolder);
+
+        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof FacetsFacetAnnotation);
+        final FacetsFacetAnnotation facetsFacet = (FacetsFacetAnnotation) facet;
+        final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories();
+        assertEquals(2, facetFactories.length);
+        assertEquals(CustomerFacetFactory.class, facetFactories[0]);
+        assertEquals(CustomerFacetFactory2.class, facetFactories[1]);
+    }
+
+    public void testFacetsFactoryNoop() {
+        @Facets
+        class Customer {
+        }
+
+        facetFactory.process(Customer.class, methodRemover, facetHolder);
+
+        final Facet facet = facetHolder.getFacet(FacetsFacet.class);
+        assertNull(facet);
+    }
+
+}

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -24,10 +24,10 @@ import java.lang.reflect.Method;
 
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.ident.icon.IconFacet;
 import org.apache.isis.core.progmodel.facets.object.ident.icon.IconFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.object.ident.icon.IconMethodFacetFactory;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class IconMethodFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -23,10 +23,10 @@ package org.apache.isis.core.progmodel.f
 import org.apache.isis.applib.annotation.Plural;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.ident.plural.PluralAnnotationFacetFactory;
 import org.apache.isis.core.progmodel.facets.object.ident.plural.PluralFacet;
 import org.apache.isis.core.progmodel.facets.object.ident.plural.PluralFacetAnnotation;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class PluralAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -24,10 +24,10 @@ import java.lang.reflect.Method;
 
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.ident.plural.PluralFacet;
 import org.apache.isis.core.progmodel.facets.object.ident.plural.PluralFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.object.ident.plural.PluralMethodFacetFactory;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class PluralMethodFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -25,9 +25,9 @@ import java.lang.reflect.Method;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.naming.named.NamedFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.ident.singular.NamedFacetViaMethod;
 import org.apache.isis.core.progmodel.facets.object.ident.singular.SingularMethodFacetFactory;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class SingularMethodFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -25,11 +25,11 @@ import java.lang.reflect.Method;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.runtimecontext.spec.IntrospectableSpecificationAbstract;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.ident.title.TitleFacet;
 import org.apache.isis.core.progmodel.facets.object.ident.title.TitleFacetViaTitleMethod;
 import org.apache.isis.core.progmodel.facets.object.ident.title.TitleFacetViaToStringMethod;
 import org.apache.isis.core.progmodel.facets.object.ident.title.TitleMethodFacetFactory;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class TitleMethodFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -25,9 +25,9 @@ import org.apache.isis.applib.annotation
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.immutable.ImmutableAnnotationFacetFactory;
 import org.apache.isis.core.progmodel.facets.object.immutable.ImmutableFacetAnnotation;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class ImmutableAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -27,9 +27,9 @@ import org.apache.isis.applib.marker.Nev
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.immutable.ImmutableFacetMarkerInterface;
 import org.apache.isis.core.progmodel.facets.object.immutable.ImmutableMarkerInterfacesFacetFactory;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class ImmutableMarkerInterfaceFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -24,10 +24,10 @@ import org.apache.isis.applib.annotation
 import org.apache.isis.applib.annotation.NotPersistable.By;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.notpersistable.NotPersistableAnnotationFacetFactory;
 import org.apache.isis.core.progmodel.facets.object.notpersistable.NotPersistableFacet;
 import org.apache.isis.core.progmodel.facets.object.notpersistable.NotPersistableFacetAnnotation;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class NotPersistableAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -24,10 +24,10 @@ import org.apache.isis.applib.marker.Non
 import org.apache.isis.applib.marker.ProgramPersistable;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.notpersistable.NotPersistableFacet;
 import org.apache.isis.core.progmodel.facets.object.notpersistable.NotPersistableFacetMarkerInterface;
 import org.apache.isis.core.progmodel.facets.object.notpersistable.NotPersistableMarkerInterfacesFacetFactory;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class NotPersistableMarkerInterfaceFacetFactoryTest extends AbstractFacetFactoryTest {

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -17,209 +17,222 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.object.parseable;
 
-package org.apache.isis.core.progmodel.facets.object.parseable;
-
-import org.apache.isis.applib.adapters.Parser;
-import org.apache.isis.applib.annotation.Parseable;
+import org.apache.isis.applib.adapters.Parser;
+import org.apache.isis.applib.annotation.Parseable;
 import org.apache.isis.core.metamodel.config.internal.PropertiesConfiguration;
 import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
-import org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetAbstract;
-import org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetFactory;
-import org.apache.isis.core.progmodel.facets.object.parseable.ParserUtil;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
-
-
-public class ParseableFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private ParseableFacetFactory facetFactory;
-    private PropertiesConfiguration propertiesConfiguration;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new ParseableFacetFactory();
-        propertiesConfiguration = new PropertiesConfiguration();
-        facetFactory.setIsisConfiguration(propertiesConfiguration);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-    @Override
-    public void testFeatureTypes() {
-        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertTrue(contains(featureTypes, ObjectFeatureType.OBJECT));
-        assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
-        assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));
-        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION));
-        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION_PARAMETER));
-    }
-
-    public void testFacetPickedUp() {
-
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
-
-        final ParseableFacet facet = facetHolder.getFacet(ParseableFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof ParseableFacetAbstract);
-    }
-
-    public void testFacetFacetHolderStored() {
-
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
-
-        final ParseableFacetAbstract parseableFacet = (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
-        assertEquals(facetHolder, parseableFacet.getFacetHolder());
-    }
-
-    public void testNoMethodsRemoved() {
-
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
-
-        assertNoMethodsRemoved();
-    }
-
-    @Parseable(parserName = "org.apache.isis.metamodel.facets.object.parseable.ParseableFacetFactoryTest$MyParseableUsingParserName")
-    public static class MyParseableUsingParserName extends ParserNoop<MyParseableUsingParserName> {
-
-        /**
-         * Required since is a Parser.
-         */
-        public MyParseableUsingParserName() {}
-    }
-
-    public void testParseableUsingParserName() {
-
-        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
-
-        final ParseableFacetAbstract parseableFacet = (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
-        assertEquals(MyParseableUsingParserName.class, parseableFacet.getParserClass());
-    }
-
-    public static class ParserNoop<T> implements Parser<T> {
-        public T parseTextEntry(final T context, final String entry) {
-            return null;
-        }
-
-        public int typicalLength() {
-            return 0;
-        }
-
-        public String displayTitleOf(final T object) {
-            return null;
-        }
-        
-        public String displayTitleOf(T object, String usingMask) {
-            return null;
-        }
-
-        public String parseableTitleOf(final T existing) {
-            return null;
-        }
-    }
-
-    @Parseable(parserClass = MyParseableUsingParserClass.class)
-    public static class MyParseableUsingParserClass extends ParserNoop<MyParseableUsingParserClass> {
-        /**
-         * Required since is a Parser.
-         */
-        public MyParseableUsingParserClass() {}
-    }
-
-    public void testParseableUsingParserClass() {
-
-        facetFactory.process(MyParseableUsingParserClass.class, methodRemover, facetHolder);
-
-        final ParseableFacetAbstract parseableFacet = (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
-        assertEquals(MyParseableUsingParserClass.class, parseableFacet.getParserClass());
-    }
-
-    public void testParseableMustBeAParser() {
-    // no test, because compiler prevents us from nominating a class that doesn't
-    // implement Parser
-    }
-
-    @Parseable(parserClass = MyParseableWithoutNoArgConstructor.class)
-    public static class MyParseableWithoutNoArgConstructor extends ParserNoop<MyParseableWithoutNoArgConstructor> {
-
-        // no no-arg constructor
-
-        public MyParseableWithoutNoArgConstructor(final int value) {}
-    }
-
-    public void testParseableHaveANoArgConstructor() {
-        facetFactory.process(MyParseableWithoutNoArgConstructor.class, methodRemover, facetHolder);
-
-        final ParseableFacetAbstract parseableFacet = (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
-        assertNull(parseableFacet);
-    }
-
-    @Parseable(parserClass = MyParseableWithoutPublicNoArgConstructor.class)
-    public static class MyParseableWithoutPublicNoArgConstructor extends ParserNoop<MyParseableWithoutPublicNoArgConstructor> {
-
-        // no public no-arg constructor
-        MyParseableWithoutPublicNoArgConstructor() {
-            this(0);
-        }
-
-        public MyParseableWithoutPublicNoArgConstructor(final int value) {}
-    }
-
-    public void testParseableHaveAPublicNoArgConstructor() {
-        facetFactory.process(MyParseableWithoutPublicNoArgConstructor.class, methodRemover, facetHolder);
-
-        final ParseableFacetAbstract parseableFacet = (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
-        assertNull(parseableFacet);
-    }
-
-    @Parseable()
-    public static class MyParseableWithParserSpecifiedUsingConfiguration extends
-            ParserNoop<MyParseableWithParserSpecifiedUsingConfiguration> {
-
-        /**
-         * Required since is a Parser.
-         */
-        public MyParseableWithParserSpecifiedUsingConfiguration() {}
-    }
-
-    public void testParserNameCanBePickedUpFromConfiguration() {
-        final String className = "org.apache.isis.metamodel.facets.object.parseable.ParseableFacetFactoryTest$MyParseableWithParserSpecifiedUsingConfiguration";
-        propertiesConfiguration.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);
-        assertNotNull(facet);
-        assertEquals(MyParseableWithParserSpecifiedUsingConfiguration.class, facet.getParserClass());
-    }
-
-    public static class NonAnnotatedParseableParserSpecifiedUsingConfiguration extends
-            ParserNoop<NonAnnotatedParseableParserSpecifiedUsingConfiguration> {
-
-        /**
-         * Required since is a Parser.
-         */
-        public NonAnnotatedParseableParserSpecifiedUsingConfiguration() {}
-    }
-
-    public void testNonAnnotatedParseableCanPickUpParserFromConfiguration() {
-        final String className = "org.apache.isis.metamodel.facets.object.parseable.ParseableFacetFactoryTest$NonAnnotatedParseableParserSpecifiedUsingConfiguration";
-        propertiesConfiguration.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);
-        assertNotNull(facet);
-        assertEquals(NonAnnotatedParseableParserSpecifiedUsingConfiguration.class, facet.getParserClass());
-    }
-
-    private String canonical(final String className) {
-        return className.replace('$', '.');
-    }
-
-}
-
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+
+public class ParseableFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private ParseableFacetFactory facetFactory;
+    private PropertiesConfiguration propertiesConfiguration;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new ParseableFacetFactory();
+        propertiesConfiguration = new PropertiesConfiguration();
+        facetFactory.setIsisConfiguration(propertiesConfiguration);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    @Override
+    public void testFeatureTypes() {
+        final ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
+        assertTrue(contains(featureTypes, ObjectFeatureType.OBJECT));
+        assertFalse(contains(featureTypes, ObjectFeatureType.PROPERTY));
+        assertFalse(contains(featureTypes, ObjectFeatureType.COLLECTION));
+        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION));
+        assertFalse(contains(featureTypes, ObjectFeatureType.ACTION_PARAMETER));
+    }
+
+    public void testFacetPickedUp() {
+
+        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+
+        final ParseableFacet facet = facetHolder.getFacet(ParseableFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof ParseableFacetAbstract);
+    }
+
+    public void testFacetFacetHolderStored() {
+
+        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+
+        final ParseableFacetAbstract parseableFacet =
+            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+        assertEquals(facetHolder, parseableFacet.getFacetHolder());
+    }
+
+    public void testNoMethodsRemoved() {
+
+        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+
+        assertNoMethodsRemoved();
+    }
+
+    @Parseable(parserName = "org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetFactoryTest$MyParseableUsingParserName")
+    public static class MyParseableUsingParserName extends ParserNoop<MyParseableUsingParserName> {
+
+        /**
+         * Required since is a Parser.
+         */
+        public MyParseableUsingParserName() {
+        }
+    }
+
+    public void testParseableUsingParserName() {
+
+        facetFactory.process(MyParseableUsingParserName.class, methodRemover, facetHolder);
+
+        final ParseableFacetAbstract parseableFacet =
+            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+        assertEquals(MyParseableUsingParserName.class, parseableFacet.getParserClass());
+    }
+
+    public static class ParserNoop<T> implements Parser<T> {
+        @Override
+        public T parseTextEntry(final T context, final String entry) {
+            return null;
+        }
+
+        @Override
+        public int typicalLength() {
+            return 0;
+        }
+
+        @Override
+        public String displayTitleOf(final T object) {
+            return null;
+        }
+
+        @Override
+        public String displayTitleOf(T object, String usingMask) {
+            return null;
+        }
+
+        @Override
+        public String parseableTitleOf(final T existing) {
+            return null;
+        }
+    }
+
+    @Parseable(parserClass = MyParseableUsingParserClass.class)
+    public static class MyParseableUsingParserClass extends ParserNoop<MyParseableUsingParserClass> {
+        /**
+         * Required since is a Parser.
+         */
+        public MyParseableUsingParserClass() {
+        }
+    }
+
+    public void testParseableUsingParserClass() {
+
+        facetFactory.process(MyParseableUsingParserClass.class, methodRemover, facetHolder);
+
+        final ParseableFacetAbstract parseableFacet =
+            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+        assertEquals(MyParseableUsingParserClass.class, parseableFacet.getParserClass());
+    }
+
+    public void testParseableMustBeAParser() {
+        // no test, because compiler prevents us from nominating a class that doesn't
+        // implement Parser
+    }
+
+    @Parseable(parserClass = MyParseableWithoutNoArgConstructor.class)
+    public static class MyParseableWithoutNoArgConstructor extends ParserNoop<MyParseableWithoutNoArgConstructor> {
+
+        // no no-arg constructor
+
+        public MyParseableWithoutNoArgConstructor(final int value) {
+        }
+    }
+
+    public void testParseableHaveANoArgConstructor() {
+        facetFactory.process(MyParseableWithoutNoArgConstructor.class, methodRemover, facetHolder);
+
+        final ParseableFacetAbstract parseableFacet =
+            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+        assertNull(parseableFacet);
+    }
+
+    @Parseable(parserClass = MyParseableWithoutPublicNoArgConstructor.class)
+    public static class MyParseableWithoutPublicNoArgConstructor extends
+        ParserNoop<MyParseableWithoutPublicNoArgConstructor> {
+
+        // no public no-arg constructor
+        MyParseableWithoutPublicNoArgConstructor() {
+            this(0);
+        }
+
+        public MyParseableWithoutPublicNoArgConstructor(final int value) {
+        }
+    }
+
+    public void testParseableHaveAPublicNoArgConstructor() {
+        facetFactory.process(MyParseableWithoutPublicNoArgConstructor.class, methodRemover, facetHolder);
+
+        final ParseableFacetAbstract parseableFacet =
+            (ParseableFacetAbstract) facetHolder.getFacet(ParseableFacet.class);
+        assertNull(parseableFacet);
+    }
+
+    @Parseable()
+    public static class MyParseableWithParserSpecifiedUsingConfiguration extends
+        ParserNoop<MyParseableWithParserSpecifiedUsingConfiguration> {
+
+        /**
+         * Required since is a Parser.
+         */
+        public MyParseableWithParserSpecifiedUsingConfiguration() {
+        }
+    }
+
+    public void testParserNameCanBePickedUpFromConfiguration() {
+        final String className =
+            "org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetFactoryTest$MyParseableWithParserSpecifiedUsingConfiguration";
+        propertiesConfiguration.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);
+        assertNotNull(facet);
+        assertEquals(MyParseableWithParserSpecifiedUsingConfiguration.class, facet.getParserClass());
+    }
+
+    public static class NonAnnotatedParseableParserSpecifiedUsingConfiguration extends
+        ParserNoop<NonAnnotatedParseableParserSpecifiedUsingConfiguration> {
+
+        /**
+         * Required since is a Parser.
+         */
+        public NonAnnotatedParseableParserSpecifiedUsingConfiguration() {
+        }
+    }
+
+    public void testNonAnnotatedParseableCanPickUpParserFromConfiguration() {
+        final String className =
+            "org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetFactoryTest$NonAnnotatedParseableParserSpecifiedUsingConfiguration";
+        propertiesConfiguration.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);
+        assertNotNull(facet);
+        assertEquals(NonAnnotatedParseableParserSpecifiedUsingConfiguration.class, facet.getParserClass());
+    }
+
+    private String canonical(final String className) {
+        return className.replace('$', '.');
+    }
+
+}

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=1032873&r1=1032872&r2=1032873&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 Tue Nov  9 07:16:39 2010
@@ -24,10 +24,10 @@ import java.lang.reflect.Method;
 
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectFacet;
 import org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectFacetViaValidateMethod;
 import org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectViaValidateMethodFacetFactory;
-import org.apache.isis.metamodel.facets.AbstractFacetFactoryTest;
 
 
 public class ObjectValidMethodFacetFactoryTest extends AbstractFacetFactoryTest {



Mime
View raw message