|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
[jira] Created: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-TestsCan't mock classes in Eclipse JUnit Plugin-Tests
------------------------------------------------ Key: JMOCK-124 URL: http://jira.codehaus.org/browse/JMOCK-124 Project: jMock Issue Type: Bug Affects Versions: 2.1.0-RC4 Reporter: Ulli Hafner Hi Nat, when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) at org.jmock.Mockery.dispatch(Mockery.java:187) at org.jmock.Mockery.access$000(Mockery.java:34) at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 46 more Caused by: java.lang.NullPointerException at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Updated: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nat Pryce updated JMOCK-124: ---------------------------- Assignee: Nat Pryce Fix Version/s: 2.1.0 Component/s: Library > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_96351 ] Nat Pryce commented on JMOCK-124: --------------------------------- What is the class-loader structure used to load classes into your plugin tests? Where is the jMock JAR loaded from in this structure? Is jMock loaded from a class loader that can see the mocked type? It might be that you need to write a new Imposteriser that knows how to load classes from the Eclipse workspace. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_96353 ] Nat Pryce commented on JMOCK-124: --------------------------------- The SearchingClassLoader should not be throwing null-pointer exceptions. I've checked a fix for that into CVS. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_96448 ] Ulli Hafner commented on JMOCK-124: ----------------------------------- Hi Nat, as far as I understand the eclipse class loading strategies, each plugin uses its own class loader, classes from other plugins are not visible here (for details see http://www.eclipsezone.com/articles/eclipse-vms/). E.g., when I have the plugin foo with the class Foo and the plugin foo.test with the class FooTest then these classes are loaded by different class loaders. Only the plugin foo.tests has references to the jmock and cglib library. Maybe its not possible at all to generate classes dynamically in the eclipse runtime with cglib? Best regards, Ulli > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_96503 ] Nat Pryce commented on JMOCK-124: --------------------------------- Is there anything you can do with "buddy" class loaders? Is the foo.test bundle a buddy of the foo bundle? Does that even make a difference? I'm afraid I don't know anything about writing Eclipse plugins. If you could make the smallest Eclipse project that demonstrates this problem and send attach it as a tar.gz file I could open it in my IDE and trace through what's going on in the jMock classloader. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Updated: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ulli Hafner updated JMOCK-124: ------------------------------ Attachment: jmock-eclipse-plugin.tar.gz 2 Eclipse plugins that expose this behavior. You still need to copy your RC4 jar files to the lib folder of the tests plugin. The test is quite simple: One class MockMe in the example plugin and a corresponding MockMeTest class in the tests plugin. The first method returns an object of the type MockMe, the second a String. The first test fails , the second works. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-plugin.tar.gz > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_96606 ] Ulli Hafner commented on JMOCK-124: ----------------------------------- Hi Nat, I just tried the Eclipse buddy policy for this example and the test case runs! In the example plugin manifest add: Eclipse-BuddyPolicy: registered In the tests plugin add: Eclipse-RegisterBuddy: jmock.example In my previous attempts I simple interchanged these definitions... However, my "real" testcase still does not work. This testcase has a lot of dependencies to other plugins. It is hard to find out for which other plugins I need to define this buddy policy (maybe for all my projects?). It would be nice if you could catch the exception and add additional information, e.g., which class could not be loaded. Then I can add the required buddy policy for the logged classes only. Thanks, Ulli > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-plugin.tar.gz > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Closed: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nat Pryce closed JMOCK-124. --------------------------- Resolution: Cannot Reproduce I've raised another issue for better reporting of class-loading problems. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-plugin.tar.gz > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_97053 ] Nat Pryce commented on JMOCK-124: --------------------------------- This would be a great topic for the jMock cookbook. Would you be willing to write up a short HOW-TO document describing how to use jMock with Eclipse plugin tests? I'll be happy to mark that up into HTML and post to the website. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-plugin.tar.gz > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_97364 ] Ulli Hafner commented on JMOCK-124: ----------------------------------- Hi Nat, I'll be happy to provide a Howto. I'm already planning an jmock introduction for our team so I can combine both tasks... Best regards, Ulli > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-plugin.tar.gz > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98262 ] Ulli Hafner commented on JMOCK-124: ----------------------------------- Hi Nat, sorry to bother again, but while writing some examples for our team I found another problem with the eclipse class loader. In my previous test case I mocked a String and the mock class itself which workes as expected. However, when trying to mock a java.lang.List then an exception is thrown again. While it is easy to add the eclipse buddy mechanismn for plugins I really have no clue how to do this for classes provided by the JDK. I added the additional test case in the attached projects. Note: I tried to use easymock (with class extension), and this mocking framework correctly handles this testcase. Maybe there is still a small bug somewhere? Exception: java.lang.IllegalArgumentException: could not imposterise class java.util.ArrayList at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:103) at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:59) at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) at org.jmock.Mockery.dispatch(Mockery.java:187) at org.jmock.Mockery.access$000(Mockery.java:34) at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) at org.jmock.lib.legacy.ClassImposteriser$4.invoke(ClassImposteriser.java:112) at jmock.example.MockMe$$EnhancerByCGLIB$$f0be7318.createList(<generated>) at jmock.example.tests.MockMeTest$4.<init>(MockMeTest.java:41) at jmock.example.tests.MockMeTest.testCreateList(MockMeTest.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:97) ... 43 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 46 more Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Factory at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 52 more > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-plugin.tar.gz > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Reopened: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ulli Hafner reopened JMOCK-124: ------------------------------- Reopened in order to attach the new eclipse project attachment that shows this bug. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Updated: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ulli Hafner updated JMOCK-124: ------------------------------ Attachment: (was: jmock-eclipse-plugin.tar.gz) > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Updated: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ulli Hafner updated JMOCK-124: ------------------------------ Attachment: jmock-eclipse-tests.zip 2 Eclipse plugins that expose this bug. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-tests.zip > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98537 ] Nat Pryce commented on JMOCK-124: --------------------------------- I can reproduce the problem when I run a plugin test, but not when I run the unit tests normally. > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-tests.zip > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98562 ] Ulli Hafner commented on JMOCK-124: ----------------------------------- Yes, it occurs only for plugin-unit test. Eclipse does not use its classloader "hell" when starting normal unit tests. When changing all the jmock calls to corresponding easymock calls, then everything works fine? And as far as I know the easymock class extension also works with the cglib class library. BTW: While debugging this testcases I notices that the 2.1 jars seem to be linked with the wrong sources. When stopping at a breakpoint line the current line was not in sync with source line, I stepped somewhere Iin a JavaDoc comment when I should be in a method body... > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-tests.zip > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_99096 ] Paulo Silveira commented on JMOCK-124: -------------------------------------- It seems that eclipse´s plugins classloader does not allow access to sun.* magic classes to bypass the constructors and so on. Ulli, do you really need a java.util.ArrayList mock? wouldnt java.util.List be enough? > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-tests.zip > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Commented: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_99099 ] Ulli Hafner commented on JMOCK-124: ----------------------------------- Mocking of an ArrayList ist not required, typically my signatures use List<T> as parameter (or return value). > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0-RC4 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Fix For: 2.1.0 > > Attachments: jmock-eclipse-tests.zip > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
[jira] Updated: (JMOCK-124) Can't mock classes in Eclipse JUnit Plugin-Tests[ http://jira.codehaus.org/browse/JMOCK-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nat Pryce updated JMOCK-124: ---------------------------- Affects Version/s: (was: 2.1.0-RC4) 2.1.0 Fix Version/s: (was: 2.1.0) > Can't mock classes in Eclipse JUnit Plugin-Tests > ------------------------------------------------ > > Key: JMOCK-124 > URL: http://jira.codehaus.org/browse/JMOCK-124 > Project: jMock > Issue Type: Bug > Components: Library > Affects Versions: 2.1.0 > Reporter: Ulli Hafner > Assignee: Nat Pryce > Attachments: jmock-eclipse-tests.zip > > > Hi Nat, > when I'm mocking classes with the new 2.1 features, I get an exception for eclipse plugin tests. > On the other hand, when using interfaces in the same unit tests then jmock works well both with Eclipse standard JUnit tests as well as with JUnit Plugin-Tests (the plugin tests start the tests in an eclipse instance with the eclipse class loading mechanisms activated)! > This seems to be a problem of the cglib Library, so I'm not sure whether to file a bug report in this project rather than here (the cglib project seems to be not very active)... I also tried easymock and rmock with cglib: the same behavior, an exception with plugin tests and everything ok with simple JUnit tests. > net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > at org.jmock.lib.legacy.ClassImposteriser.createProxyClass(ClassImposteriser.java:76) > at org.jmock.lib.legacy.ClassImposteriser.imposterise(ClassImposteriser.java:54) > at org.jmock.internal.ReturnDefaultValueAction.invoke(ReturnDefaultValueAction.java:62) > at org.jmock.Mockery.dispatch(Mockery.java:187) > at org.jmock.Mockery.access$000(Mockery.java:34) > at org.jmock.Mockery$MockObject.invoke(Mockery.java:236) > at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27) > at org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36) > at org.jmock.lib.legacy.ClassImposteriser$3.invoke(ClassImposteriser.java:85) > at com.avaloq.adt.env.core.model.dbobjects.impl.TaskDBObjectImpl$$EnhancerByCGLIB$$90026834.getChanges(<generated>) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest$2.<init>(TaskAuditJobTest.java:55) > at com.avaloq.adt.env.internal.ui.properties.audit.model.TaskAuditJobTest.testMe(TaskAuditJobTest.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) > at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > at org.eclipse.core.launcher.Main.run(Main.java:977) > at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > ... 46 more > Caused by: java.lang.NullPointerException > at org.jmock.internal.SearchingClassLoader.findClass(SearchingClassLoader.java:54) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > ... 52 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |