This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 75550 - J2MEUNIT - test method signature should have capitalized words
Summary: J2MEUNIT - test method signature should have capitalized words
Status: VERIFIED WONTFIX
Alias: None
Product: javame
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 5.x
Hardware: PC All
: P3 blocker with 1 vote (vote)
Assignee: Jiri Prazak
URL:
Keywords:
Depends on:
Blocks: 77184
  Show dependency tree
 
Reported: 2006-04-26 13:09 UTC by Lukas Hasik
Modified: 2007-07-12 09:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Hasik 2006-04-26 13:09:57 UTC
060426

-current status
method to be tested:
public String myMethod()
testing method:
public void testmyMethod()

-the testing method should look in this way
public void testMyMethod()

*the testing method must capitalize first letter of the origin method
Comment 1 Lukas Hasik 2006-05-31 19:56:24 UTC
still issue in 060531
Comment 2 Jiri Prazak 2006-06-01 20:42:56 UTC
Even though this is a convention, it is not required by the Java language
itself, therefore it means that a user might have 2 methods named

myMethod
MyMethod

using the approach you mention would mean that there could be no test method
created for the myMethod which is not correct.  I also employ two way
synchronization so when user deletes one method in the tested class, the
corresponding test method will get removed from the test class.  I use the names
to keep track of this.  Otherwise I would have to have persistent storage
somewhere to keep track of this which also would cause unneccessary overhead.

I'm closing this issue as invalid.
Comment 3 Jiri Prazak 2006-06-01 20:50:44 UTC
Current JUnit support just generates test method for one of them and skips the
other one.  This is not correct.
Comment 4 Lukas Hasik 2006-06-02 10:04:40 UTC
IMHO, we should follow standards. When a user doesn't follow the naming
convention then it is his not ours problem.


http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367
http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html paragraph
6.8.3 Method Names

I thing that the myMethod+MyMethod is corner case but when JUnit support ignores
it we can do the same. I'll fill new bug for Junit support...

I'm suggesting this solution:
-When there is name conflict between MyMethod and myMethod ignore the
non-standard one. Generate the test method only for the myMethod. 
-When there is only MyMethod then generate the test method for it, of course.
The name will be testMyMethod again. 
-When the user deletes myMethod from the class (and MyMethod remains) then he
will have to solve the problem with regeneration of the testMyMethod by deleting
the testMyMethod first - manually.
-Let's keep it simple

Comment 5 Lukas Hasik 2006-06-23 15:09:21 UTC
moving to mobility component
Comment 6 ulfzibis 2006-07-21 14:29:51 UTC
I agree to lhasik's last comment:

-Let's keep it simple

Comment 7 Jiri Prazak 2006-09-11 09:11:43 UTC
Leaving as is since there were no other objections except from Lukas and Ulf. 
In my opinion the way it is now is as simple as it gets.  Otherwise the
behaviour could confuse some people who are not accustomed to the Java
conventions and could come across as unpredictable.  Closing.
Comment 8 Lukas Hasik 2007-07-12 09:11:56 UTC
setting up the target milestone.