-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from Rancho-7/master
Support for JMeter test script
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,7 @@ | |
- 更新日期:2020-10-12 | ||
- 更新内容: | ||
1. 此版本优化了插件源码加载逻辑,提升用户体验 | ||
|
||
- 更新日期:2023-12-6 | ||
- 更新内容: | ||
1. 支持JMeter测试脚本生成 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* smart-doc | ||
* | ||
* Copyright (C) 2018-2023 smart-doc | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package com.ly.doc.plugin.mojo; | ||
|
||
import com.ly.doc.builder.JMeterBuilder; | ||
import com.ly.doc.model.ApiConfig; | ||
import com.ly.doc.plugin.constant.MojoConstants; | ||
import com.thoughtworks.qdox.JavaProjectBuilder; | ||
import org.apache.maven.plugins.annotations.Execute; | ||
import org.apache.maven.plugins.annotations.LifecyclePhase; | ||
import org.apache.maven.plugins.annotations.Mojo; | ||
import org.apache.maven.plugins.annotations.ResolutionScope; | ||
|
||
/** | ||
* @author Lansg | ||
*/ | ||
@Execute(phase = LifecyclePhase.COMPILE) | ||
@Mojo(name = MojoConstants.JMETER_MOJO, requiresDependencyResolution = ResolutionScope.COMPILE) | ||
public class JMeterMojo extends BaseDocsGeneratorMojo { | ||
|
||
@Override | ||
public void executeMojo(ApiConfig apiConfig, JavaProjectBuilder javaProjectBuilder) { | ||
try { | ||
JMeterBuilder.buildApiDoc(apiConfig, javaProjectBuilder); | ||
} catch (Throwable e) { | ||
getLog().error(e); | ||
if (apiConfig.isStrict()) { | ||
throw new RuntimeException(e.getMessage()); | ||
} | ||
} | ||
} | ||
} |