Results 1 to 4 of 4
  1. #1
    Kat
    Kat is offline Member
    Join Date
    Nov 2007
    Posts
    2
    Rep Power
    0

    Default Mocking static methods of class

    Hi, i am unable to mock static methods of a class on which i only have read permissions. please help..

  2. #2
    Turtle is offline Member
    Join Date
    Nov 2007
    Location
    New Zealand
    Posts
    36
    Rep Power
    0

    Default

    It is possible to mock static methods by using the new Java 5 instrumentaion framework.
    There is a project jmockit (https://jmockit.dev.java.net/) that does exactly this.
    source: tododoingdone: Mocking static methods?

  3. #3
    Kat
    Kat is offline Member
    Join Date
    Nov 2007
    Posts
    2
    Rep Power
    0

    Default Thanks but..........

    Thanks, I am aware of jmockit but can't use it because I have been provided with a Weblogic that works on jre1.4 . Is there any other way to achieve it??:(

  4. #4
    robertom is offline Member
    Join Date
    Nov 2007
    Posts
    1
    Rep Power
    0

    Default

    Try with https://jeasytest.dev.java.net/ is an Eclipse plugin that can mock constructor and static method invocations

Similar Threads

  1. Abstract Class with Static Methods
    By bugger in forum New To Java
    Replies: 7
    Last Post: 09-05-2008, 12:20 AM
  2. Static methods - not working
    By Echilon in forum New To Java
    Replies: 2
    Last Post: 12-21-2007, 01:31 PM
  3. Why methods in an interface cannot be static?
    By cbalu in forum Advanced Java
    Replies: 2
    Last Post: 12-12-2007, 07:57 PM
  4. Static methods
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-04-2007, 05:56 PM
  5. significance of static variables and methods
    By imran_khan in forum New To Java
    Replies: 4
    Last Post: 08-02-2007, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •