Your Favourite File/Class template
Valentin Kipiatkov (JetBrains) wrote:
> Any contributions are welcome. We'd be glad to include some useful
> file/class templates contributed by users.
Which template that you created do you use often/very often.
Please share.
Alain Ravet
请先登录再写评论。
Name : TestC_
filetype : *.java
what it does : Create 1 new testcase class, with 1 placeholding
failing test method.
Comment :
I always place the tests specific - interface, canonical,
constructor, ..- to a class 'ClassName' in another class
called 'TestC_ClassName'
example:
class Person => class TestC_Person
]]>
-
package $PACKAGE_NAME;
import junit.framework.TestCase;
public class TestC_$NAME extends TestCase
{
public void testplaceholder ()
{
fail( "\n\nfail: implement me\ntest placeholder\n\n" );
}
}
-
Tastes vary ... :
-
package $;
import junit.framework.TestCase;
import junit.swingui.TestRunner;
/**
*
@author ...
@version $Id: $
*/
public class $TestCase extends TestCase { public $TestCase(String name) {
super(name);
}
public static void main(String[] args) {
TestRunner.main(new String[]{"-noloading",
${Class_name}TestCase.class.getName()});
}
}
-
Edo
Alain Ravet wrote:
On Fri, 29 Nov 2002 14:51:12 +0000, Alain Ravet wrote:
I have a simple one for Struts action classes...