gordonad / powermock

Automatically exported from code.google.com/p/powermock
0 stars 0 forks source link

Exception when using powermock with a jboss bootstrap instance #90

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am using PowerMock with jboss bootstrap instance. My testcase uses
powermock (version 1.1.1) for junit3 (by having a static suite() API). The
test case extends a org.jboss.embedded.junit.BaseTestCase to start a jboss
bootstrap instance in setup. During startup itself, it fails giving the
following exception : 

Unable to create a KernelInitializer based on the specified KernelConfig
java.lang.RuntimeException: Unable to create a KernelInitializer based on
the specified KernelConfig
        at
org.jboss.kernel.KernelFactory.createKernelInitializer(KernelFactory.java:156)
        at
org.jboss.kernel.KernelFactory.assembleNewKernel(KernelFactory.java:99)
        at org.jboss.kernel.KernelFactory.newInstance(KernelFactory.java:67)
        at
org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.bootstrap(AbstractBootstrap
.java:120)
        at
org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:
89)
        at org.jboss.embedded.Bootstrap.createKernel(Bootstrap.java:131)
        at org.jboss.embedded.Bootstrap.getInstance(Bootstrap.java:76)
        at
org.jboss.embedded.junit.BaseTestCase.bootstrap(BaseTestCase.java:95)
        at org.jboss.embedded.junit.BaseTestCase.setUp(BaseTestCase.java:66)
        at
com.digite.platform.common.DigiteEJBTestCase.setUp(DigiteEJBTestCase.java:79)
        at
com.digite.platform.common.DigiteEJBTxTestCase.setUp(DigiteEJBTxTestCase.java:25
)
        at
com.digite.platform.task.mspintegration.checkin.AssignmentBaselineCheckinAdaptor
Test.setUp(AssignmentBaselineCheckinAdaptorTest.java:47)
        at
org.powermock.modules.junit3.internal.impl.JUnit3TestSuiteChunkerImpl.run(JUnit3
TestSuiteChunkerImpl.java:157)
        at
org.powermock.modules.junit3.PowerMockSuite.run(PowerMockSuite.java:52)
Caused by: java.lang.ClassCastException:
org.jboss.kernel.plugins.bootstrap.basic.BasicKernelInitializer
        at
org.jboss.kernel.plugins.config.property.PropertyKernelConfig.createKernelInitia
lizer(PropertyKernelConfig.java:118)
        at
org.jboss.kernel.KernelFactory.createKernelInitializer(KernelFactory.java:150)

Additional Info : 
Powermock is working fine for cases where i don't need the jboss bootstrap
instance and extend my test case from TestCase. 

Original issue reported on code.google.com by nikesh.midha on 22 Jan 2009 at 10:18

GoogleCodeExporter commented 8 years ago
Hi, could you please bring this up on our mailing list (goto
http://groups.google.com/group/powermock) so that we can discuss it there? (Just
paste everything you wrote here). That way more people can follow the 
discussion.

Original comment by johan.ha...@gmail.com on 22 Jan 2009 at 1:45

GoogleCodeExporter commented 8 years ago
@PowerMockIgnore("org.jboss") could be used to get around the problem. This is a
known side-effect when using PowerMock.

Original comment by johan.ha...@gmail.com on 24 Jan 2009 at 6:54