incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1050445 [3/3] - in /incubator/isis/trunk: core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/java5/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/sp...
Date Fri, 17 Dec 2010 16:40:08 GMT
Modified: incubator/isis/trunk/examples/metamodel-examples/namefile/src/main/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/examples/metamodel-examples/namefile/src/main/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactory.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/examples/metamodel-examples/namefile/src/main/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactory.java
(original)
+++ incubator/isis/trunk/examples/metamodel-examples/namefile/src/main/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactory.java
Fri Dec 17 16:40:06 2010
@@ -20,9 +20,10 @@
 
 package org.apache.isis.metamodel.examples.facets.namefile;
 
-import java.io.IOException;
-import java.lang.reflect.Method;
-
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.List;
+
 import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.FacetUtil;
@@ -44,7 +45,8 @@ public class NameFileFacetFactory implem
         }
     }
 
-    public ObjectFeatureType[] getFeatureTypes() {
+    @Override
+    public List<ObjectFeatureType> getFeatureTypes() {
         return ObjectFeatureType.EVERYTHING_BUT_PARAMETERS;
     }
 
@@ -52,6 +54,7 @@ public class NameFileFacetFactory implem
     /**
      * Simply attaches a {@link NameFileFacet}.
      */
+    @Override
     public boolean process(final Class<?> cls, final MethodRemover methodRemover, final
FacetHolder holder) {
         return FacetUtil.addFacet(create(cls, holder));
     }
@@ -64,6 +67,7 @@ public class NameFileFacetFactory implem
     /**
      * Simply attaches a {@link NameFileFacet}.
      */
+    @Override
     public boolean process(final Class<?> cls, final Method method, final MethodRemover
methodRemover, final FacetHolder holder) {
     	if (!(holder instanceof Identified)) {
     		return false;
@@ -80,6 +84,7 @@ public class NameFileFacetFactory implem
     }
 
 
+    @Override
     public boolean processParams(final Method method, final int paramNum, final FacetHolder
holder) {
         // nothing to do
         return false;

Modified: incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryFeatureTypesTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryFeatureTypesTest.java?rev=1050445&r1=1050444&r2=1050445&view=diff
==============================================================================
--- incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryFeatureTypesTest.java
(original)
+++ incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryFeatureTypesTest.java
Fri Dec 17 16:40:06 2010
@@ -20,15 +20,17 @@
 
 package org.apache.isis.metamodel.examples.facets.namefile;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.collection.IsArrayContaining.hasItemInArray;
-import static org.junit.Assert.assertThat;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.Matchers.hasItem;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeatureType;
-import org.apache.isis.metamodel.examples.facets.namefile.NameFileFacetFactory;
 
 
 
@@ -48,32 +50,32 @@ public class NameFileFacetFactoryFeature
 
     @Test
     public void featureTypesLength() {
-        ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertThat(featureTypes.length, is(4));
+        List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
+        assertThat(featureTypes.size(), is(4));
     }
 
     @Test
     public void featureTypesContainsTypeRepresentingObject() {
-        ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertThat(featureTypes, hasItemInArray(ObjectFeatureType.OBJECT));
+        List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
+        assertThat(featureTypes, hasItem(ObjectFeatureType.OBJECT));
     }
 
     @Test
     public void featureTypesContainsTypeRepresentingProperty() {
-        ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertThat(featureTypes, hasItemInArray(ObjectFeatureType.PROPERTY));
+        List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
+        assertThat(featureTypes, hasItem(ObjectFeatureType.PROPERTY));
     }
 
     @Test
     public void featureTypesContainsTypeRepresentingCollection() {
-        ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertThat(featureTypes, hasItemInArray(ObjectFeatureType.COLLECTION));
+        List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
+        assertThat(featureTypes, hasItem(ObjectFeatureType.COLLECTION));
     }
 
     @Test
     public void featureTypesContainsTypeRepresentingAction() {
-        ObjectFeatureType[] featureTypes = facetFactory.getFeatureTypes();
-        assertThat(featureTypes, hasItemInArray(ObjectFeatureType.ACTION));
+        List<ObjectFeatureType> featureTypes = facetFactory.getFeatureTypes();
+        assertThat(featureTypes, hasItem(ObjectFeatureType.ACTION));
     }
 
 }



Mime
View raw message