Title: [waffle-scm] [717] trunk/waffle-core/src/test/java/org/codehaus/waffle/action: Made controller class injectable as parameter in abstract test method.

Diff

Modified: trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinderTest.java (716 => 717)

--- trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinderTest.java	2008-06-17 13:46:24 UTC (rev 716)
+++ trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinderTest.java	2008-06-17 13:49:41 UTC (rev 717)
@@ -16,8 +16,8 @@
  */
 public abstract class AbstractMethodDefinitionFinderTest {
 
-    protected Type parameterTypeForMethod(String methodName) throws IntrospectionException {
-        BeanInfo beanInfo = Introspector.getBeanInfo(ControllerWithListMethods.class);
+    protected Type parameterTypeForMethod(Class<?> controllerClass, String methodName) throws IntrospectionException {
+        BeanInfo beanInfo = Introspector.getBeanInfo(controllerClass);
         for ( MethodDescriptor md : beanInfo.getMethodDescriptors() ){
             if ( md.getMethod().getName().equals(methodName) ){
                 return md.getMethod().getGenericParameterTypes()[0];
@@ -30,8 +30,7 @@
         void listOfIntegers(List<Integer> list);
         void listOfStrings(List<String> list);
     }
-    
-   
+       
     protected static class ControllerWithDefaultActionMethod {
 
         @ActionMethod(asDefault=true, parameters = { "helloworld" })

Modified: trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AnnotatedMethodDefinitionFinderTest.java (716 => 717)

--- trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AnnotatedMethodDefinitionFinderTest.java	2008-06-17 13:46:24 UTC (rev 716)
+++ trunk/waffle-core/src/test/java/org/codehaus/waffle/action/AnnotatedMethodDefinitionFinderTest.java	2008-06-17 13:49:41 UTC (rev 717)
@@ -546,7 +546,7 @@
         final StringTransmuter stringTransmuter = mockery.mock(StringTransmuter.class);
         mockery.checking(new Expectations() {
             {
-                one(stringTransmuter).transmute("one,two", parameterTypeForMethod("listOfStrings"));
+                one(stringTransmuter).transmute("one,two", parameterTypeForMethod(ControllerWithListMethods.class, "listOfStrings"));
                 will(returnValue(list));
             }
         });
@@ -591,7 +591,7 @@
         final StringTransmuter stringTransmuter = mockery.mock(StringTransmuter.class);
         mockery.checking(new Expectations() {
             {
-                one(stringTransmuter).transmute("1,2", parameterTypeForMethod("listOfIntegers"));
+                one(stringTransmuter).transmute("1,2", parameterTypeForMethod(ControllerWithListMethods.class, "listOfIntegers"));
                 will(returnValue(list));
             }
         });
@@ -861,7 +861,7 @@
         final StringTransmuter stringTransmuter = mockery.mock(StringTransmuter.class);
         mockery.checking(new Expectations() {
             {
-                one(stringTransmuter).transmute("blah", parameterTypeForMethod("listOfStrings"));
+                one(stringTransmuter).transmute("blah", parameterTypeForMethod(ControllerWithListMethods.class, "listOfStrings"));
                 will(returnValue(Collections.EMPTY_LIST));
             }
         });

Modified: trunk/waffle-core/src/test/java/org/codehaus/waffle/action/ParanamerMethodDefinitionFinderTest.java (716 => 717)

--- trunk/waffle-core/src/test/java/org/codehaus/waffle/action/ParanamerMethodDefinitionFinderTest.java	2008-06-17 13:46:24 UTC (rev 716)
+++ trunk/waffle-core/src/test/java/org/codehaus/waffle/action/ParanamerMethodDefinitionFinderTest.java	2008-06-17 13:49:41 UTC (rev 717)
@@ -729,7 +729,7 @@
         final StringTransmuter stringTransmuter = mockery.mock(StringTransmuter.class);
         mockery.checking(new Expectations() {
             {
-                one(stringTransmuter).transmute("blah", parameterTypeForMethod("listOfStrings"));
+                one(stringTransmuter).transmute("blah", parameterTypeForMethod(ControllerWithListMethods.class, "listOfStrings"));
                 will(returnValue(Collections.EMPTY_LIST));
             }
         });


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to