tiebin-zhang / powermock

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

ImageIO.read(file) doesnt work for jpg with @RunWith(PowerMockRunner.class) #359

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a test with the @RunWith(PowerMockRunner.class) annotation
2. use ImageIO.read(file) to try and read a jpg
3.

What is the expected output? What do you see instead?
in the below test, you expect to see a pass, instead you see a 
java.lang.UnsatisfiedLinkError: 

What version of the product are you using? On what operating system?
MacOSX Lion
owermock 1.4.10

Please provide any additional information below.

example code.....

@RunWith(PowerMockRunner.class)
public class ImageServiceImplTest {
    File testJpg;

    @Before
    public void setup() throws IOException {
        testJpg = new ClassPathResource("image/sf.jpg").getFile();
    }

    @Test
    public void test_image_io() throws IOException {

        BufferedImage bufferedImage = ImageIO.read(testJpg);
    }
}

Original issue reported on code.google.com by charliei...@googlemail.com on 16 Dec 2011 at 12:22

GoogleCodeExporter commented 9 years ago
Isn't this a duplicate of issue 141?

Original comment by agiann...@kioos.com on 4 Jan 2012 at 5:50

GoogleCodeExporter commented 9 years ago
Looks like the same issue, but I am using Mockito, not EasyMock

Original comment by charliei...@googlemail.com on 5 Jan 2012 at 2:05