Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 74305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:20:14+00:00 2026-05-10T20:20:14+00:00

The JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods

  • 0

The JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is?

The classes I’m referring to are: junit.framework.Assert and org.junit.Assert.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:20:15+00:00Added an answer on May 10, 2026 at 8:20 pm

    The old method (of JUnit 3) was to mark the test-classes by extending junit.framework.TestCase. That inherited junit.framework.Assert itself and your test class gained the ability to call the assert methods this way.

    Since version 4 of JUnit, the framework uses Annotations for marking tests. So you no longer need to extend TestCase. But that means, the assert methods aren’t available. But you can make a static import of the new Assert class. That’s why all the assert methods in the new class are static methods. So you can import it this way:

    import static org.junit.Assert.*; 

    After this static import, you can use this methods without prefix.

    At the redesign they also moved to the new package org.junit that follows better the normal conventions for package naming.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Here's the point; you shouldn't do sync IO in Silverlight.… May 11, 2026 at 11:55 am
  • added an answer In your custom control (or make wrappers for standard controls… May 11, 2026 at 11:55 am
  • added an answer Are Groups and Participants ObservableCollection objects? Try using this: static… May 11, 2026 at 11:55 am

Related Questions

The JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods
How can we find the junit tests in our suite that take the longest
Maybe it's just me, but I cannot understand the documentation regarding Junit test integration
How do I create test suites with JUnit 4? All the documentation I've seen
I'm trying to run my junit tests using ant. The tests are kicked off
When attempting to commit file in the jsunit directory in my working-copy, I waited
JsUnit provides an ant-script with the target 'standalone_test'. This target uses the property url
The CodePlex team has a Slack time policy, and it's worked out very well
The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based
The MSDN documentation on Object.GetHashCode() describes 3 contradicting rules for how the method should

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.