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 141166 - [65cat]wrong error Test class name contain space in the end
Summary: [65cat]wrong error Test class name contain space in the end
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Marian Petras
URL:
Keywords: SIMPLEFIX, UI
Depends on:
Blocks:
 
Reported: 2008-07-22 14:23 UTC by _ theanuradha
Modified: 2009-04-02 07:28 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen shot (25.08 KB, image/png)
2008-07-22 14:24 UTC, _ theanuradha
Details
Updated_test_class (1.44 KB, patch)
2008-07-25 21:53 UTC, _ theanuradha
Details | Diff
Fix_for_141166 (1.14 KB, patch)
2008-07-25 21:54 UTC, _ theanuradha
Details | Diff
Please use this Patch (2.64 KB, patch)
2008-07-26 00:08 UTC, _ theanuradha
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ theanuradha 2008-07-22 14:23:24 UTC
wrong error when Test class name contain space in the end 
should it trim and validate :-)
see screen shot
Comment 1 _ theanuradha 2008-07-22 14:24:02 UTC
Created attachment 65240 [details]
screen shot
Comment 2 Marian Petras 2008-07-23 09:20:57 UTC
Maybe.
Comment 3 _ theanuradha 2008-07-23 10:25:13 UTC
Well this happen vary easy and when it give error it is really hard to pick up :-)(at least to newcomer) so I going to
fix this
Comment 4 _ theanuradha 2008-07-25 21:52:53 UTC
I have fixed bug and update test class also. Will attache both test patch and fix patch.
Comment 5 _ theanuradha 2008-07-25 21:53:41 UTC
Created attachment 65682 [details]
Updated_test_class
Comment 6 _ theanuradha 2008-07-25 21:54:20 UTC
Created attachment 65683 [details]
Fix_for_141166
Comment 7 _ theanuradha 2008-07-26 00:08:14 UTC
Created attachment 65694 [details]
Please use this Patch
Comment 8 _ theanuradha 2008-07-28 15:23:01 UTC
Please review the patch I have sign the SCA
Comment 9 Marian Petras 2008-07-28 15:39:33 UTC
I will review it tomorrow CET (GMT+2).
Comment 10 _ theanuradha 2008-07-29 12:38:54 UTC
>>I will review it tomorrow CET (GMT+2).
did you try out ? is working for you 
Comment 11 Marian Petras 2008-07-30 14:12:57 UTC
I just reviewed it.

Among other changes, you changed the following condition in methods insertUpdate() and removeUpdate():

   -     if (documentEvent.getDocument().getLength() != 1
   +     if (documentEvent.getLength() != 1

By this change, the modified condition is now met only in the following cases:
  - the text-field was empty and the first character was inserted
  - the text-field contained two characters and the second one was deleted

Although the use of the complex code in the else-branches of the above methods is much reduced, it is still called in
the above enumerated cases. The original complex code in the else-branches is not accommodated appropriately so it does
not work as it should. For example, by following the steps below, you get to the state that there is no class name
entered but the OK button is still enabled:

   1) Invoke action "Create JUnit Tests" such that the "Create Tests" dialogue is displayed.
   Then, in the dialogue:
   2) Delete the default test class name.
   3) Type " k" (without the quotes).
   4) Delete "k".

I will fix this bug together with bug #141165 that you have also filed. I will probably fix it by removing most of the
complex code that is currently in class ClassNameTextField and replacing it with a much simpler code. The simpler code
will be slightly slower but it might be noticeable only on very slow machines.
   
Comment 12 Marian Petras 2008-11-25 16:25:32 UTC
Sorry, I did not manage to fix this in NB 6.5.
Comment 13 Marian Petras 2009-03-31 14:58:05 UTC
I will fix this by filtering out space characters while typing the class name to the text-field.
Comment 14 Marian Petras 2009-03-31 16:01:04 UTC
Fixed.

Changeset:
2658f4f8d71f
(http://hg.netbeans.org/main/rev/2658f4f8d71f)
Comment 15 Quality Engineering 2009-04-02 07:28:41 UTC
Integrated into 'main-golden', will be available in build *200904020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2658f4f8d71f
User: Marian Petras <mpetras@netbeans.org>
Log: fixed bug #141166 - "wrong error Test class name contain space in the end"