|
From: Keith D. <kd...@cs...> - 2004-04-15 15:50:01
|
I have a case for failure with getPropertyValue() on BeanWrapper and was wondering if anyone could shed some light... Here's the situation - - In my test suite, I have a static inner class called "TestBean" with several properties that return dummy values. - In one of my test cases, I create a new instance of TestBean, = anonymously overriding several of the public getters to return different values. On the BeanWrapper getPropertyValue() call I get this exception: org.springframework.beans.FatalBeanException: Illegal attempt to get property 'test' threw exception; nested exception is java.lang.IllegalAccessException: java.lang.IllegalAccessException: Class org.springframework.beans.BeanWrapperImpl can not access a member of = class org.springframework.rules.RulesTestSuite$1 with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57) at java.lang.reflect.Method.invoke(Method.java:317) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImp= l.j ava:459) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImp= l.j ava:446) at org.springframework.rules.functions.GetProperty.evaluate(GetProperty.java= :41 ) at org.springframework.rules.predicates.BeanPropertiesExpression.test(BeanPr= ope rtiesExpression.java:70) at org.springframework.rules.predicates.UnaryOr.test(UnaryOr.java:66) at org.springframework.rules.predicates.CompoundBeanPropertyExpression.test(= Com poundBeanPropertyExpression.java:68) at org.springframework.rules.Rules.test(Rules.java:154) at org.springframework.rules.RulesTestSuite.testCompoundRules(RulesTestSuite= .ja va:246) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRu nner.java:410) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunn= er. java:294) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRun= ner .java:182) Is this just not supported? I guess I was expecting it to work. Keith |