idea-config-repo/junitgenerator-app-settings...

11 lines
5.8 KiB
XML
Raw Normal View History

<application>
<component name="JUnitGeneratorAppSettings">
<option name="selectedTemplateKey" value="JUnit 4" />
<option name="vmTemplates">
<map>
<entry key="JUnit 3" value="######################################################################################## &#10;## &#10;## Available variables: &#10;## $entryList.methodList - List of method composites &#10;## $entryList.privateMethodList - List of private method composites &#10;## $entryList.fieldList - ArrayList of class scope field names &#10;## $entryList.className - class name &#10;## $entryList.packageName - package name &#10;## $today - Todays date in MM/dd/yyyy format &#10;## &#10;## MethodComposite variables: &#10;## $method.name - Method Name &#10;## $method.signature - Full method signature in String form &#10;## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) &#10;## $method.paramNames - List of Strings representing the method's parameters' names &#10;## $method.paramClasses - List of Strings representing the method's parameters' classes &#10;## &#10;## You can configure the output class name using &quot;testClass&quot; variable below. &#10;## Here are some examples: &#10;## Test${entry.ClassName} - will produce TestSomeClass &#10;## ${entry.className}Test - will produce SomeClassTest &#10;## &#10;######################################################################################## &#10;## &#10;#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end &#10;## Iterate through the list and generate testcase for every entry. &#10;#foreach ($entry in $entryList) &#10;#set( $testClass=&quot;${entry.className}Test&quot;) &#10;## &#10;package test.$entry.packageName; &#10;&#10;import junit.framework.Test; &#10;import junit.framework.TestSuite; &#10;import junit.framework.TestCase; &#10;&#10;/** &#10;* ${entry.className} Tester. &#10;* &#10;* @author &lt;Authors name&gt; &#10;* @since &lt;pre&gt;$today&lt;/pre&gt; &#10;* @version 1.0 &#10;*/ &#10;public class $testClass extends TestCase { &#10;public $testClass(String name) { &#10;super(name); &#10;} &#10;&#10;public void setUp() throws Exception { &#10;super.setUp(); &#10;} &#10;&#10;public void tearDown() throws Exception { &#10;super.tearDown(); &#10;} &#10;&#10;#foreach($method in $entry.methodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;} &#10;&#10;#end &#10;&#10;#foreach($method in $entry.privateMethodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;#foreach($string in $method.reflectionCode) &#10;$string &#10;#end &#10;} &#10;&#10;#end &#10;&#10;public static Test suite() { &#10;return new TestSuite(${testClass}.class); &#10;} &#10;} &#10;#end" />
<entry key="JUnit 4" value="######################################################################################## &#10;## &#10;## Available variables: &#10;## $entryList.methodList - List of method composites &#10;## $entryList.privateMethodList - List of private method composites &#10;## $entryList.fieldList - ArrayList of class scope field names &#10;## $entryList.className - class name &#10;## $entryList.packageName - package name &#10;## $today - Todays date in MM/dd/yyyy format &#10;## &#10;## MethodComposite variables: &#10;## $method.name - Method Name &#10;## $method.signature - Full method signature in String form &#10;## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) &#10;## $method.paramNames - List of Strings representing the method's parameters' names &#10;## $method.paramClasses - List of Strings representing the method's parameters' classes &#10;## &#10;## You can configure the output class name using &quot;testClass&quot; variable below. &#10;## Here are some examples: &#10;## Test${entry.ClassName} - will produce TestSomeClass &#10;## ${entry.className}Test - will produce SomeClassTest &#10;## &#10;######################################################################################## &#10;## &#10;#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end &#10;## Iterate through the list and generate testcase for every entry. &#10;#foreach ($entry in $entryList) &#10;#set( $testClass=&quot;${entry.className}Test&quot;) &#10;## &#10;package $entry.packageName; &#10;&#10;import org.junit.Test; &#10;import org.junit.Before; &#10;import org.junit.After; &#10;&#10;/** &#10;* ${entry.className} Tester. &#10;* &#10;* @author &lt;Authors name&gt; &#10;* @since &lt;pre&gt;$date&lt;/pre&gt; &#10;* @version 1.0 &#10;*/ &#10;public class $testClass { &#10;&#10;@Before&#10;public void before() throws Exception { &#10;} &#10;&#10;@After&#10;public void after() throws Exception { &#10;} &#10;&#10;#foreach($method in $entry.methodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;@Test&#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;} &#10;&#10;#end &#10;&#10;#foreach($method in $entry.privateMethodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;@Test&#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;#foreach($string in $method.reflectionCode) &#10;$string &#10;#end &#10;} &#10;&#10;#end &#10;} &#10;#end" />
</map>
</option>
</component>
</application>