Author: epunzalan
Date: Wed Mar 29 00:53:15 2006
New Revision: 389710

URL: http://svn.apache.org/viewcvs?rev=389710&view=rev
Log:
Made the unit tests pass

Modified:
    
maven/sandbox/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugins/testing/AbstractMojoTestCase.java

Modified: 
maven/sandbox/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugins/testing/AbstractMojoTestCase.java
URL: 
http://svn.apache.org/viewcvs/maven/sandbox/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugins/testing/AbstractMojoTestCase.java?rev=389710&r1=389709&r2=389710&view=diff
==============================================================================
--- 
maven/sandbox/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugins/testing/AbstractMojoTestCase.java
 (original)
+++ 
maven/sandbox/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugins/testing/AbstractMojoTestCase.java
 Wed Mar 29 00:53:15 2006
@@ -269,8 +269,11 @@
     protected Object getVariableValueFromObject( Object object, String 
variable )
         throws IllegalAccessException
     {
-        return ReflectionUtils.getFieldByNameIncludingSuperclasses( variable, 
object.getClass() );
+        Field field = ReflectionUtils.getFieldByNameIncludingSuperclasses( 
variable, object.getClass() );
 
+        field.setAccessible( true );
+
+        return field.get( object );
     }
 
 
@@ -279,6 +282,21 @@
      *
      * Note: the values in the map are of type Object so the caller is 
responsible for casting to desired types.
      *
+     * @param object
+     * @return map of variable names and values
+     */
+    protected Map getVariablesAndValuesFromObject( Object object )
+        throws IllegalAccessException
+    {
+        return getVariablesAndValuesFromObject( object.getClass(), object );
+    }
+
+    /**
+     * convience method to obtain all variables and values from the mojo 
(including its superclasses)
+     *
+     * Note: the values in the map are of type Object so the caller is 
responsible for casting to desired types.
+     *
+     * @param clazz
      * @param object
      * @return map of variable names and values
      */


Reply via email to