OpenPojo / openpojo

POJO Testing & Identity Management Made Trivial
http://openpojo.com
Apache License 2.0
156 stars 40 forks source link

InnerClass not found (ReflectionException; No matching constructor) #119

Closed myron0815 closed 5 years ago

myron0815 commented 6 years ago

Have an outer/inner class example. OpenPojo does not find Constructor, although listed as param?

com.openpojo.reflection.exception.ReflectionException: No matching constructor for [class com.mycompany.Outer$Inner] found using parameters[[class com.mycompany.Outer$Inner, class com.mycompany.Outer]]
    at com.openpojo.reflection.exception.ReflectionException.getInstance(ReflectionException.java:38)
    at com.openpojo.reflection.construct.InstanceFactory.doGetInstance(InstanceFactory.java:124)
    at com.openpojo.reflection.construct.InstanceFactory.getInstance(InstanceFactory.java:75)
    at com.openpojo.reflection.construct.InstanceFactory.getLeastCompleteInstance(InstanceFactory.java:103)
    at com.openpojo.validation.utils.ValidationHelper.getBasicInstance(ValidationHelper.java:64)
    at com.openpojo.validation.test.impl.SetterTester.run(SetterTester.java:40)
    at com.openpojo.validation.utils.ValidationHelper.runValidation(ValidationHelper.java:102)
    at com.openpojo.validation.impl.DefaultValidator.validate(DefaultValidator.java:46)
    at com.openpojo.validation.impl.DefaultValidator.validate(DefaultValidator.java:51)
    at com.mycompany.PojoTest.testPojoStructureAndBehavior(PojoTest.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

SSCCE_119.zip

swatilmi commented 5 years ago

Hi ,i am also facing similar issue.Is there any solution for this?

oshoukry commented 5 years ago

Please upgrade to OpenPojo version 0.8.12+.