1

PowerMockito で SpringCamelContext unittest をテストする状況があり、次のエラーが表示されます。解決方法を知っている人はいますか? 申し込めば

@Rule
    public PowerMockRule rule = new PowerMockRule();

そして、次の依存関係。

<dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4-rule</artifactId>
            <version>1.7.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-classloading-xstream</artifactId>
            <version>1.7.1</version>
            <scope>test</scope>
        </dependency>

次に、次のエラーが発生します。

 com.thoughtworks.xstream.converters.ConversionException: Could not call java.security.CodeSource.readObject() : null
    ---- Debugging information ----
    message             : Could not call java.security.CodeSource.readObject()
    cause-exception     : java.lang.RuntimeException
    cause-message       : null
    class               : java.security.CodeSource
    required-type       : java.security.CodeSource
    converter-type      : com.thoughtworks.xstream.converters.reflection.SerializableConverter
    path                : /org.powermock.modules.junit4.rule.PowerMockStatement$1/outer-class/fNext/next/next/target/template/camelContext/applicationContextClassLoader/parent/defaultDomain/codesource/java.security.CodeSource
    line number         : 18917
    class[1]            : java.security.ProtectionDomain
    converter-type[1]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
    class[2]            : sun.misc.Launcher$ExtClassLoader
    class[3]            : sun.misc.Launcher$AppClassLoader
    class[4]            : org.apache.camel.spring.SpringCamelContext
    class[5]            : org.apache.camel.impl.DefaultProducerTemplate
    class[6]            : com.narayan.dummy.test.drools.DroolsUnitTest
    class[7]            : org.junit.internal.runners.statements.InvokeMethod
    class[8]            : org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
    class[9]            : org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
    class[10]           : org.powermock.modules.junit4.rule.PowerMockStatement
    class[11]           : org.powermock.modules.junit4.rule.PowerMockStatement$1
    version             : 1.4.7

解決方法わかる方いますか????

4

1 に答える 1