文章目录提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言一、JunitG是什么?二、JunitG的配置
1.下载JunitG2.生成测试类2、JunitG配置JunitG Junit4配置 总结
前言
提示:这里可以添加本文要记录的大概内容:
JunitG的学习
提示:以下是本篇文章正文内容,下面案例可供参考
一、JunitG是什么?JunitG是一种测试自动生成生成框架。
二、JunitG的配置 1.下载JunitGIDEA插件(plugins)中搜索JunitGenerator下载安装2.生成测试类
可以使用右键菜单、快捷键(Alt + Enter 或 Ctrl + Shift + T)
生成代码如下:
Output Path 设置
S
O
U
R
C
E
P
A
T
H
/
.
.
/
.
.
/
t
e
s
t
/
j
a
v
a
/
{SOURCEPATH}/../../test/java/
SOURCEPATH/../../test/java/{PACKAGE}/${FILENAME}
########################################################################################
##
## Available variables:
## $entryList.methodList - List of method composites
## $entryList.privateMethodList - List of private method composites
## $entryList.fieldList - ArrayList of class scope field names
## $entryList.className - class name
## $entryList.packageName - package name
## $today - Todays date in MM/dd/yyyy format
##
## MethodComposite variables:
## $method.name - Method Name
## $method.signature - Full method signature in String form
## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods)
## $method.paramNames - List of Strings representing the method's parameters' names
## $method.paramClasses - List of Strings representing the method's parameters' classes
##
## You can configure the output class name using "testClass" variable below.
## Here are some examples:
## Test${entry.ClassName} - will produce TestSomeClass
## ${entry.className}Test - will produce SomeClassTest
##
########################################################################################
##
#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end
## Iterate through the list and generate testcase for every entry.
#foreach ($entry in $entryList)
#set( $testClass="${entry.className}Test")
##
package $entry.packageName;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
public class $testClass {
@Before
public void before() throws Exception {
}
@After
public void after() throws Exception {
}
#foreach($method in $entry.methodList)
@Test
public void test#cap(${method.name})() throws Exception {
//TODO: Test goes here...
}
#end
#foreach($method in $entry.privateMethodList)
@Test
public void test#cap(${method.name})() throws Exception {
//TODO: Test goes here...
#foreach($string in $method.reflectionCode)
$string
#end
}
#end
}
#end
总结
提示:这里对文章进行总结:
例如:以上就是今天要讲的内容,本文仅仅简单介绍了pandas的使用,而pandas提供了大量能使我们快速便捷地处理数据的函数和方法。



