Results 1 to 6 of 6
  1. #1
    Richard3 is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default @RunWith(Parameterized.class) extended class error

    For some reason when I run the my Junit test I get a no public constructor error and the test fails, I have managed to run this test without the @RunWith(Parameterized.class) and it works, I also am able to run tests with the @RunWith(Parameterized.class) if the class does not extend any other class. The code I am having problems with is pasted below. I would appreciate any help you could offer me as I am completely new to java.
    Last edited by Richard3; 01-31-2012 at 06:52 PM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,172
    Rep Power
    20

    Default Re: @RunWith(Parameterized.class) extended class error

    What's the full exception, possibly with stack trace?

  3. #3
    Richard3 is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Re: @RunWith(Parameterized.class) extended class error

    All i have is this@RunWith(Parameterized.class) extended class error-untitled.jpg

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,172
    Rep Power
    20

    Default Re: @RunWith(Parameterized.class) extended class error

    Pretty self explanatory.
    JUnit needs the test case to have a no parameter constructor, or one which takes a String (and passes that to the same TestCase constructor).
    Java Code:
    public MyExcelSeleniumTest() {
    }
    or
    public MyExcelSeleniumTest(String name) {
    super(name);
    }

  5. #5
    Richard3 is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Re: @RunWith(Parameterized.class) extended class error

    I have done all that, it does not work, i can make it run, but get error saying no tests found, or make it run but the values which should be comming from the Excel sheet are null. its how do you arrange the constructor as to not upset the @RunWith(Parameterized.class), yes the constructor will run but the @RunWith(Parameterized.class) wont, i.e all data is null

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,172
    Rep Power
    20

    Default Re: @RunWith(Parameterized.class) extended class error

    OK, I'm losing track of what exceptions where.

    With the RunWith(Parameterized), what exception do you get?

    Also, what does SpreadsheetData.getData() return? Is it correct?

    Finally, do you know whether you can do this for subclasses of existing TestCases?

Similar Threads

  1. Replies: 1
    Last Post: 07-21-2011, 11:46 PM
  2. Extended Class - Cannot Find Symbol
    By javak in forum New To Java
    Replies: 15
    Last Post: 02-27-2011, 05:43 PM
  3. Replies: 0
    Last Post: 04-15-2010, 01:00 PM
  4. Returned type changes if class is extended. How?
    By Gelembjuk in forum New To Java
    Replies: 10
    Last Post: 10-31-2008, 12:18 PM
  5. Replies: 1
    Last Post: 05-17-2008, 12:06 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
  •