From: Pico G. <pi...@so...> - 2005-02-16 08:49:24
|
Hi all. I'm struggling to get into MockObjects. I'm using MockObject because many of my methods are network related, and are hard (or impossible) to test with the real objects. I'm using EasyMock with Class Extentions to test a certain method. The class that I now want to Mock is Java's NetworkInterface. Problem is that this class does not have a public constructor, which makes it hard to mock [code] MockControl interfaceControl =3D MockClassControl.createControl(NetworkInterface.class); [/code] The line of code above causes the following exception: java.lang.IllegalArgumentException: No visible constructors in class java.net.NetworkInterface Could someone please point me in the right direction on how to mock these types of objects? Thanks in advance. Pico |