powermock

Powermock Slows Down Test Startup on Eclipse/Fedora 10 when on NTFS partition

I've just started having a proper play with Powermock and noticed that it slows down test startup immensely. A quick look at top while it was running shows that mount.nfts-3g was taking up most of the CPU. I moved Eclipse and my source directory to ext3 partitions to see if that was a problem and the tests now startup quicker but there...

Powermock and problem loading jar file file during unit test with JUnit 4 in eclipse

I am using powermock 1.2.5 to perform a class that saves data into Oracle database. When I run my test my unit test fails with the following exception: NoSuchAlgorithmException : DES Algorithm can be found. After debugging the code I found out that this exception is thrown when my application is trying to set the password to establish...

Running Junit & PowerMock with Mockito through PowerMockRunner from maven

Hi, I am not being able to run Powermock through maven. I'm the PowerMock Mockito and PowerMockRunner for driving a jUnit test. Here's the test: @RunWith(PowerMockRunner.class) @PrepareForTest( { UserLocalServiceUtil.class, ExpandoBridge.class }) public class AlertNotificationsTest { //... I haven't configured anyting special for ru...

Junit Parameterized tests together with Powermock - how!?

Hi! I've been trying to figure out how to run parameterized tests in Junit4 together with PowerMock. The problem is that to use PowerMock you need to decorate your test class with @RunWith(PowerMockRunner.class) and to use parameterized tests you have to decorate with @RunWith(Parameterized.class) From what I can see they ...

powermock : ProcessBuilder redirectErrorStream giving nullPointerException

I am using powermock to mock some native command invocation using process builder. the strange thing is these test pass sometimes and fail sometimes giving a NPE. Is this a powermock issue or some gotcha in the program. the snippet of the class under test is.. public void method1(String jsonString, String filename) { try { ...

testing the class that returns the service using powermock?

hi, I want to test certain underlying services using powermock. but it is complicated. i would like to get your suggestion public interface service{ public void some_method(){ } } public serviceclient implements service { ... } public myserviceclient { public service getService(){ return service; } } I have written a servi...

Attempt to stub android Activity class using PowerMockito throws RuntimeException "Stub!"

I found this example where they used PowerMock and EasyMock to stub/mock the Menu and MenuItem classes for android. I have been trying to do something similar with PowerMock and Mockito with the Activity class. I understand that a lot of the methods are final and that in the Android.jar they all just throw RuntimeException("Stub!"). I...