Code cleanup of test cases in standard modules. By no means complete, just what I got around to. context_api_64621_root javaee5_merge2 release50_beta_260905 version-2-3-45 version-2-3-46 version-2-3-48
authorjglick@netbeans.org
Thu, 15 Sep 2005 20:09:27 +0000
changeset 64646f5aeb0cb6
parent 63 c79c772de47c
child 65 691f1d33fe5d
Code cleanup of test cases in standard modules. By no means complete, just what I got around to.
1. suite() methods that just included the tests introspected in the class. This is the default anyway.
2. main() methods that didn't do anything special. The Ant harness should handle this instead.
3. No-op overrides of setUp or tearDown - empty or only called super.
4. tearDown overrides which only nulled out vars which setUp would always initialize anyway.
5. Old or missing copyright notices.
6. Unnecessary unimported FQNs and import list cleanups.
7. Obsolete or pointless comments left behind by some wizard.
8. Empty Javadoc comments. (Why do people write these?!)
A disturbing number of test cases were not compilable to begin with and still won't be.
serverplugins/sun/appsrv81/test in particular is in poor condition.
Make sure xtest/instance/master-config.xml#unit-nb lists your module if you care about its tests!
openide.util/test/unit/src/org/openide/util/datatransfer/ExClipboardTest.java
     1.1 --- a/openide.util/test/unit/src/org/openide/util/datatransfer/ExClipboardTest.java	Wed Sep 14 10:02:03 2005 +0000
     1.2 +++ b/openide.util/test/unit/src/org/openide/util/datatransfer/ExClipboardTest.java	Thu Sep 15 20:09:27 2005 +0000
     1.3 @@ -13,9 +13,9 @@
     1.4  
     1.5  package org.openide.util.datatransfer;
     1.6  
     1.7 -import junit.framework.*;
     1.8 -import java.awt.datatransfer.*;
     1.9 -import javax.swing.event.EventListenerList;
    1.10 +import java.awt.datatransfer.StringSelection;
    1.11 +import java.awt.datatransfer.Transferable;
    1.12 +import junit.framework.TestCase;
    1.13  
    1.14  /** 
    1.15   *
    1.16 @@ -38,21 +38,12 @@
    1.17          };
    1.18      }
    1.19  
    1.20 -    protected void tearDown () throws Exception {
    1.21 -    }
    1.22 -
    1.23 -    public static Test suite () {
    1.24 -        TestSuite suite = new TestSuite(ExClipboardTest.class);
    1.25 -        
    1.26 -        return suite;
    1.27 -    }
    1.28 -
    1.29      public void testAddRemoveClipboardListener () {
    1.30          
    1.31 -        class L implements org.openide.util.datatransfer.ClipboardListener {
    1.32 +        class L implements ClipboardListener {
    1.33              public int cnt;
    1.34 -            public org.openide.util.datatransfer.ClipboardEvent ev;
    1.35 -            public void clipboardChanged (org.openide.util.datatransfer.ClipboardEvent ev) {
    1.36 +            public ClipboardEvent ev;
    1.37 +            public void clipboardChanged (ClipboardEvent ev) {
    1.38                  cnt++;
    1.39                  this.ev = ev;
    1.40              }