溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

ngrinder測試工具注意事項

發(fā)布時間:2020-06-25 17:10:28 來源:網(wǎng)絡(luò) 閱讀:316 作者:知止內(nèi)明 欄目:編程語言

1、下載源碼

https://github.com/naver/ngrinder/releases
ngrinder測試工具注意事項

2、導入idea

3、修改pom.xml文件:

<groupId>net.sf.grinder</groupId>
            <artifactId>grinder</artifactId>
            <version>3.9.1</version

4、源碼出現(xiàn)報錯修改:


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;
    }
}

順利啟動成功

ngrinder測試工具注意事項

打包命令:
-DskipTests,不執(zhí)行測試用例,但編譯測試用例類生成相應(yīng)的class文件至target/test-classes下。
-Dmaven.test.skip=true,不執(zhí)行測試用例,也不編譯測試用例類。
一 使用maven.test.skip,不但跳過單元測試的運行,也跳過測試代碼的編譯。
mvn package -Dmaven.test.skip=true

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI