Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Deprecation in assert?

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Deprecation in assert?

    In java it is saying my assertEquals method is deprecated, what does this mean?

    I'm trying to make a test method, and its literally crossing out the assertEquals.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Deprecation in assert?

    Why not look at the latest API for the classes and methods you are using - it will tell you faster than anyone of us can. I presume you are using JUnit?
    Assert (JUnit API)
    Last edited by copeg; November 26th, 2011 at 12:35 PM.

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Deprecation in assert?

    yes, im using JUnit.

    i have assertEquals("failure", double, method)

    Where failure is the console text if the method doesnt work
    Double is a number
    and the method is an object calling a getter method.

    I don't see why I would be getting deprecated.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Deprecation in assert?

    I don't see why I would be getting deprecated.
    Again, read my post above. The API should explicitly state the method as deprecated, and possibly suggest alternatives.