Please consider reporting this to the maintainers of org.powermock.reflect.internal.WhiteboxImpl

497 views
Skip to first unread message

PETER LENAHAN

unread,
Aug 3, 2019, 2:04:35 AM8/3/19
to PowerMock
I am only reporting these WARNINGS  because the message asked me to.
I have the other warnings, and I do not expect you to resolve those problems for me.
I assume that my Config may be causing the WARNING messages.

Properties file org/powermock/default.properties is found in 2 places: 
ConfigurationSource{location='file:/C:/Users/jtest1/eclipse-workspace/.metadata/.plugins/com.parasoft.xtest.testassist.eclipse/lib-uta/powermock-mockito2-2.0.2-full.jar!/org/powermock/default.properties}
ConfigurationSource{location='file:/C:/Users/jtest1/.m2/repository/org/powermock/powermock-core/2.0.2/powermock-core-2.0.2.jar!/org/powermock/default.properties}
. Which one will be used is undefined. Please, remove duplicated configuration file (or second PowerMock jar file) from class path to have stable tests.Properties file org/powermock/default.properties is found in 2 places: 
ConfigurationSource{location='file:/C:/Users/jtest1/eclipse-workspace/.metadata/.plugins/com.parasoft.xtest.testassist.eclipse/lib-uta/powermock-mockito2-2.0.2-full.jar!/org/powermock/default.properties}
ConfigurationSource{location='file:/C:/Users/jtest1/.m2/repository/org/powermock/powermock-core/2.0.2/powermock-core-2.0.2.jar!/org/powermock/default.properties}
. Which one will be used is undefined. Please, remove duplicated configuration file (or second PowerMock jar file) from class path to have stable tests.WARNING: An illegal reflective access operation has occurred



WARNING: Illegal reflective access by org.powermock.reflect.internal.WhiteboxImpl (file:/C:/Users/jtest1/eclipse-workspace/.metadata/.plugins/com.parasoft.xtest.testassist.eclipse/lib-uta/powermock-mockito2-2.0.2-full.jar) to method java.lang.Object.clone()
WARNING: Please consider reporting this to the maintainers of org.powermock.reflect.internal.WhiteboxImpl
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release



Properties file org/powermock/default.properties is found in 2 places: 
ConfigurationSource{location='file:/C:/Users/jtest1/eclipse-workspace/.metadata/.plugins/com.parasoft.xtest.testassist.eclipse/lib-uta/powermock-mockito2-2.0.2-full.jar!/org/powermock/default.properties}
ConfigurationSource{location='file:/C:/Users/jtest1/.m2/repository/org/powermock/powermock-core/2.0.2/powermock-core-2.0.2.jar!/org/powermock/default.properties}
. Which one will be used is undefined. Please, remove duplicated configuration file (or second PowerMock jar file) from class path to have stable tests.Properties file org/powermock/default.properties is found in 2 places: 
ConfigurationSource{location='file:/C:/Users/jtest1/eclipse-workspace/.metadata/.plugins/com.parasoft.xtest.testassist.eclipse/lib-uta/powermock-mockito2-2.0.2-full.jar!/org/powermock/default.properties}
ConfigurationSource{location='file:/C:/Users/jtest1/.m2/repository/org/powermock/powermock-core/2.0.2/powermock-core-2.0.2.jar!/org/powermock/default.properties}
. Which one will be used is undefined. Please, remove duplicated configuration file (or second PowerMock jar file) from class path to have stable tests.


This was the code I wrote, and could not run.

@RunWith(PowerMockRunner.class)
@PrepareForTest(ApplicationValues.class)
public class ApplicationValuesTest {

// Parasoft Jtest UTA: Object under test
@InjectMocks
ApplicationValues underTest = ApplicationValues.getApplicationValues();

@BeforeClass
public static void setSystemProperties() {

      PowerMockito.mockStatic(System.class);

      PowerMockito.when(
        System.getProperty(ApplicationValueNames.IBI_DOCUMENT_ROOT.name(),
                           System.getenv(ApplicationValueNames.IBI_DOCUMENT_ROOT.name())
                           )
               ).thenReturn("IBI_DOCUMENT_ROOT");
      

      PowerMockito.when(
    System.getProperty(ApplicationValueNames.IBI_USER_ROOT.name(),
                           System.getenv(ApplicationValueNames.IBI_USER_ROOT.name())
                           )
           ).thenReturn("IBI_USER_ROOT");
      
 
Reply all
Reply to author
Forward
0 new messages