https://github.com/naver/ngrinder/releases
<groupId>net.sf.grinder</groupId>
<artifactId>grinder</artifactId>
<version>3.9.1</version
import org.ngrinder.infra.config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* Dynamic creation of {@link PerfTestService} depending on the cluster enable or disable.
*
* @author JunHo Yoon
* @since 3.1
*/
@Configuration
@Profile("production")
@EnableScheduling
@EnableTransactionManagement
@EnableAspectJAutoProxy
public class PerfTestServiceConfig implements ApplicationContextAware {
@Autowired
private Config config;
private ApplicationContext applicationContext;
/**
* Create PerTest service depending on cluster mode.
*
* @return {@link PerfTestService}
*/
@Bean(name = "perfTestService")
public PerfTestService perfTestService() {
if (config.isClustered()) {
return applicationContext.getAutowireCapableBeanFactory().createBean(ClusteredPerfTestService.class);
} else {
return applicationContext.getAutowireCapableBeanFactory().createBean(PerfTestService.class);
}
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
}
打包命令:
-DskipTests,不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下。
-Dmaven.test.skip=true,不执行测试用例,也不编译测试用例类。
一 使用maven.test.skip,不但跳过单元测试的运行,也跳过测试代码的编译。
mvn package -Dmaven.test.skip=true
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。