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

  • Home
  • SEARCH
  • 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 119431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:39:07+00:00 2026-05-11T03:39:07+00:00

I am currently using JUnit 4.4 and Java 1.6.x. And after a recent code

  • 0

I am currently using JUnit 4.4 and Java 1.6.x. And after a recent code fix, we started getting this AssertionFailedError in my JUnit tests on the method:

UtilityTest.testParseDate(4t): Mon Jan 15 09:26:07 PST 2001 expected: ‘Mon Jan 15 09:26:07 PST 2001’ but was: ‘Mon Jan 15 09:26:07 PST 2001’

junit.framework.AssertionFailedError: UtilityTest.testParseDate(4t): Mon Jan 15 09:26:07 PST 2001 expected: but was: at UtilityTest.testParseDate(Unknown Source)

As you can see, the expected and actual appear identical, and after several code inspections, we can find no obvious error in the code. Test runs with actual data have also produced correct (expected) results.

Has anyone seen this behavior before in JUnit, and if so, did you find the cause and/or a fix?

I have seen the same thing in previous versions of Java and JUnit myself: always somewhat random when it occurs, and usually the only fix ‘that worked’ was to retype the chunk of code in from scratch. Weird, yet that was tne only way to remove this error. I’m trying to find out something more ‘concrete’ in the behavior this time.

Thanks,

-Richard

  • 1 1 Answer
  • 1 View
  • 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-11T03:39:08+00:00Added an answer on May 11, 2026 at 3:39 am

    Can you post the code for UtilityTest.testParseDate()?

    Are you using assertEquals() on the date values or are you comparing them in another fashion? If so, can you assert that the millisecond timestamps are equal instead of the dates themselves?

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

Sidebar

Ask A Question

Stats

  • Questions 99k
  • Answers 99k
  • 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
  • Editorial Team
    Editorial Team added an answer There is no speed difference between the two. You're comparing… May 11, 2026 at 7:48 pm
  • Editorial Team
    Editorial Team added an answer I've written a mail app or three in my days.… May 11, 2026 at 7:48 pm
  • Editorial Team
    Editorial Team added an answer Well, those are "hardcoded" at some level. Countries of the… May 11, 2026 at 7:48 pm

Related Questions

Currently, I am working on a new version control system as part of a
My Ant build includes a junit task that runs some tests. In order for
I am involved in a project in which public API documentation is a clear
I'm confused about what the various testing appliances in Ruby on Rails are for.

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.