Analytix: problem in generated test cases with Date() class

CodePro AnalytiX (Audit & Test), includes over 1000 audit rules and metrics, JUnit test generation & editing, code coverage, and duplicate code analysis

Moderators: gnebling, jwren, Eric Clayberg, Dan Rubel, Brian Wilkerson, dcarew

Analytix: problem in generated test cases with Date() class

Postby Oni Kudaki » Wed Jan 19, 2011 7:29 am

hi,

when generating a test case for a class utilizing Date(), this is the result:

public void testGetValues_1()
throws Exception {
[...]
new Date();
// add additional test code here
[...]
assertEquals("2011-01-19 11:10:51", result.get("date"));
}


this obviously has to _always_ fail, since 'new Date()' generates a date from System.currentTimeMilis(), which is then always compared to some hard-wired string referring to the time of test case generation.


regards

alex
Oni Kudaki
 
Posts: 2
Joined: Tue Jan 18, 2011 2:04 am

Re: Analytix: problem in generated test cases with Date() cl

Postby gnebling » Fri Jan 21, 2011 9:27 am

Thanks for pointing that out. Will add it to our list to fix at some point in the future.
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am


Return to CodePro AnalytiX & PlusPak. EclipsePro Audit & Test

Who is online

Users browsing this forum: No registered users and 1 guest

cron