incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1234453 [21/33] - in /incubator/isis/trunk/framework/core: commons/src/main/java/org/apache/isis/core/commons/authentication/ commons/src/main/java/org/apache/isis/core/commons/components/ commons/src/main/java/org/apache/isis/core/commons...
Date Sun, 22 Jan 2012 06:59:23 GMT
Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java
(original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactoryTest.java
Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.actions.debug;
 
-package org.apache.isis.core.progmodel.facets.actions.debug;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Debug;
@@ -28,41 +27,39 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.actions.debug.DebugFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.actions.debug.annotation.DebugAnnotationFacetFactory;
-
-
-public class DebugAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private DebugAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new DebugAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-
-    public void testDebugAnnotationPickedUp() {
-        class Customer {
-            @Debug
-            public void someAction() {}
-        }
-        final Method actionMethod = findMethod(Customer.class, "someAction");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(DebugFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof DebugFacetAbstract);
-
-        assertNoMethodsRemoved();
-    }
-
-}
-
+
+public class DebugAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private DebugAnnotationFacetFactory facetFactory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new DebugAnnotationFacetFactory();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    public void testDebugAnnotationPickedUp() {
+        class Customer {
+            @Debug
+            public void someAction() {
+            }
+        }
+        final Method actionMethod = findMethod(Customer.class, "someAction");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(DebugFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof DebugFacetAbstract);
+
+        assertNoMethodsRemoved();
+    }
+
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java
(original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactoryTest.java
Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.actions.executed;
 
-package org.apache.isis.core.progmodel.facets.actions.executed;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Executed;
@@ -31,62 +30,61 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.spec.Target;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.actions.executed.annotation.ExecutedAnnotationFacetFactory;
-
-
-public class ExecutedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private ExecutedAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new ExecutedAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-
-    public void testExecutedLocallyAnnotationPickedUp() {
-        class Customer {
+
+public class ExecutedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private ExecutedAnnotationFacetFactory facetFactory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new ExecutedAnnotationFacetFactory();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    public void testExecutedLocallyAnnotationPickedUp() {
+        class Customer {
             @SuppressWarnings("unused")
-            @Executed(Where.LOCALLY)
-            public void someAction() {}
-        }
-        final Method actionMethod = findMethod(Customer.class, "someAction");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(ExecutedFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof ExecutedFacetAbstract);
-        final ExecutedFacetAbstract executedFacetAbstract = (ExecutedFacetAbstract) facet;
-        assertEquals(Target.LOCAL, executedFacetAbstract.getTarget());
-
-        assertNoMethodsRemoved();
-    }
-
-    public void testExecutedRemotelyAnnotationPickedUp() {
-        class Customer {
-            @Executed(Where.REMOTELY)
-            public void someAction() {}
-        }
-        final Method actionMethod = findMethod(Customer.class, "someAction");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(ExecutedFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof ExecutedFacetAbstract);
-        final ExecutedFacetAbstract executedFacetAbstract = (ExecutedFacetAbstract) facet;
-        assertEquals(Target.REMOTE, executedFacetAbstract.getTarget());
-
-        assertNoMethodsRemoved();
-    }
-
-}
-
+            @Executed(Where.LOCALLY)
+            public void someAction() {
+            }
+        }
+        final Method actionMethod = findMethod(Customer.class, "someAction");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(ExecutedFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof ExecutedFacetAbstract);
+        final ExecutedFacetAbstract executedFacetAbstract = (ExecutedFacetAbstract) facet;
+        assertEquals(Target.LOCAL, executedFacetAbstract.getTarget());
+
+        assertNoMethodsRemoved();
+    }
+
+    public void testExecutedRemotelyAnnotationPickedUp() {
+        class Customer {
+            @Executed(Where.REMOTELY)
+            public void someAction() {
+            }
+        }
+        final Method actionMethod = findMethod(Customer.class, "someAction");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(ExecutedFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof ExecutedFacetAbstract);
+        final ExecutedFacetAbstract executedFacetAbstract = (ExecutedFacetAbstract) facet;
+        assertEquals(Target.REMOTE, executedFacetAbstract.getTarget());
+
+        assertNoMethodsRemoved();
+    }
+
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java
(original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactoryTest.java
Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.actions.exploration;
 
-package org.apache.isis.core.progmodel.facets.actions.exploration;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Exploration;
@@ -28,42 +27,40 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.actions.exploration.ExplorationFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.actions.exploration.annotation.ExplorationAnnotationFacetFactory;
-
-
-public class ExplorationAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private ExplorationAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new ExplorationAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-
-    public void testExplorationAnnotationPickedUp() {
-        class Customer {
-            @SuppressWarnings("unused")
-			@Exploration
-            public void someAction() {}
-        }
-        final Method actionMethod = findMethod(Customer.class, "someAction");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(ExplorationFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof ExplorationFacetAbstract);
-
-        assertNoMethodsRemoved();
-    }
-
-}
-
+
+public class ExplorationAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private ExplorationAnnotationFacetFactory facetFactory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new ExplorationAnnotationFacetFactory();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    public void testExplorationAnnotationPickedUp() {
+        class Customer {
+            @SuppressWarnings("unused")
+            @Exploration
+            public void someAction() {
+            }
+        }
+        final Method actionMethod = findMethod(Customer.class, "someAction");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(ExplorationFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof ExplorationFacetAbstract);
+
+        assertNoMethodsRemoved();
+    }
+
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java
(original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactoryTest.java
Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.actions.notcontributed;
 
-package org.apache.isis.core.progmodel.facets.actions.notcontributed;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.NotContributed;
@@ -27,42 +26,40 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.actions.notcontributed.annotation.NotContributedAnnotationFacetFactory;
-
-
-public class NotContributedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private NotContributedAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new NotContributedAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-
-    public void testAnnotationPickedUp() {
-        class CustomerRepository {
-            @SuppressWarnings("unused")
-			@NotContributed
-            public void someAction() {}
-        }
-        final Method actionMethod = findMethod(CustomerRepository.class, "someAction");
-
-        facetFactory.process(new ProcessMethodContext(CustomerRepository.class, actionMethod,
methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(NotContributedFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof NotContributedFacetAbstract);
-
-        assertNoMethodsRemoved();
-    }
-
-}
-
+
+public class NotContributedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private NotContributedAnnotationFacetFactory facetFactory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new NotContributedAnnotationFacetFactory();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    public void testAnnotationPickedUp() {
+        class CustomerRepository {
+            @SuppressWarnings("unused")
+            @NotContributed
+            public void someAction() {
+            }
+        }
+        final Method actionMethod = findMethod(CustomerRepository.class, "someAction");
+
+        facetFactory.process(new ProcessMethodContext(CustomerRepository.class, actionMethod,
methodRemover, facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(NotContributedFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof NotContributedFacetAbstract);
+
+        assertNoMethodsRemoved();
+    }
+
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java
(original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuAnnotationFacetFactoryTest.java
Sun Jan 22 06:58:43 2012
@@ -28,42 +28,40 @@ import org.apache.isis.core.progmodel.fa
 import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.NotInServiceMenuFacet;
 import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.NotInServiceMenuFacetAbstract;
 import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.annotation.NotInServiceMenuAnnotationFacetFactory;
-
-
-public class NotInRepositoryMenuAnnotationFacetFactoryTest extends AbstractFacetFactoryTest
{
-
-    private NotInServiceMenuAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new NotInServiceMenuAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-
-    public void testAnnotationPickedUp() {
-        class CustomerRepository {
-            @SuppressWarnings("unused")
-			@NotInServiceMenu
-            public void someAction() {}
-        }
-        final Method actionMethod = findMethod(CustomerRepository.class, "someAction");
-
-        facetFactory.process(new ProcessMethodContext(CustomerRepository.class, actionMethod,
methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(NotInServiceMenuFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof NotInServiceMenuFacetAbstract);
-
-        assertNoMethodsRemoved();
-    }
-
-}
-
+
+public class NotInRepositoryMenuAnnotationFacetFactoryTest extends AbstractFacetFactoryTest
{
+
+    private NotInServiceMenuAnnotationFacetFactory facetFactory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new NotInServiceMenuAnnotationFacetFactory();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    public void testAnnotationPickedUp() {
+        class CustomerRepository {
+            @SuppressWarnings("unused")
+            @NotInServiceMenu
+            public void someAction() {
+            }
+        }
+        final Method actionMethod = findMethod(CustomerRepository.class, "someAction");
+
+        facetFactory.process(new ProcessMethodContext(CustomerRepository.class, actionMethod,
methodRemover, facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(NotInServiceMenuFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof NotInServiceMenuFacetAbstract);
+
+        assertNoMethodsRemoved();
+    }
+
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuMethodFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuMethodFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuMethodFacetFactoryTest.java
(original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/notinrepositorymenu/NotInRepositoryMenuMethodFacetFactoryTest.java
Sun Jan 22 06:58:43 2012
@@ -60,8 +60,7 @@ public class NotInRepositoryMenuMethodFa
         final Method actionMethod = findMethod(CustomerRepository.class, "someAction");
 
         // when
-        facetFactory.process(new ProcessMethodContext(CustomerRepository.class, actionMethod,
methodRemover,
-            facetedMethod));
+        facetFactory.process(new ProcessMethodContext(CustomerRepository.class, actionMethod,
methodRemover, facetedMethod));
 
         // then
         final Facet facet = facetedMethod.getFacet(NotInServiceMenuFacet.class);

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java
(original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactoryTest.java
Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.actions.prototype;
 
-package org.apache.isis.core.progmodel.facets.actions.prototype;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Prototype;
@@ -28,41 +27,40 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.actions.prototype.PrototypeFacet;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.progmodel.facets.actions.prototype.annotation.PrototypeAnnotationFacetFactory;
-
-
-public class PrototypeAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private PrototypeAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new PrototypeAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-    public void testAnnotationPickedUp() {
-        class Customer {
-            @SuppressWarnings("unused")
-			@Prototype
-            public void someAction() {}
-        }
-        final Method actionMethod = findMethod(Customer.class, "someAction");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(PrototypeFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof PrototypeFacetAbstract);
-
-        assertNoMethodsRemoved();
-    }
-
-}
-
+
+public class PrototypeAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private PrototypeAnnotationFacetFactory facetFactory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        facetFactory = new PrototypeAnnotationFacetFactory();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        facetFactory = null;
+        super.tearDown();
+    }
+
+    public void testAnnotationPickedUp() {
+        class Customer {
+            @SuppressWarnings("unused")
+            @Prototype
+            public void someAction() {
+            }
+        }
+        final Method actionMethod = findMethod(Customer.class, "someAction");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, actionMethod, methodRemover,
facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(PrototypeFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof PrototypeFacetAbstract);
+
+        assertNoMethodsRemoved();
+    }
+
+}



Mime
View raw message